| <?xml version="1.0" encoding="UTF-8"?> | |
| <!-- | |
| Licensed to the Apache Software Foundation (ASF) under one or more | |
| contributor license agreements. See the NOTICE file distributed with | |
| this work for additional information regarding copyright ownership. | |
| The ASF licenses this file to You under the Apache License, Version 2.0 | |
| (the "License"); you may not use this file except in compliance with | |
| the License. You may obtain a copy of the License at | |
| http://www.apache.org/licenses/LICENSE-2.0 | |
| Unless required by applicable law or agreed to in writing, software | |
| distributed under the License is distributed on an "AS IS" BASIS, | |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| See the License for the specific language governing permissions and | |
| limitations under the License. | |
| --> | |
| <beans xmlns="http://www.springframework.org/schema/beans" | |
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util" | |
| xmlns:context="http://www.springframework.org/schema/context" | |
| xmlns:amq="http://activemq.apache.org/schema/core" xmlns:jms="http://www.springframework.org/schema/jms" | |
| xmlns:p="http://www.springframework.org/schema/p" | |
| xsi:schemaLocation=" | |
| http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd | |
| http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd | |
| http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd | |
| http://www.springframework.org/schema/jms http://www.springframework.org/schema/jms/spring-jms-3.1.xsd | |
| http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd"> | |
| <context:component-scan base-package="org.apache.usergrid.persistence" /> | |
| <context:annotation-config /> | |
| <bean id="properties" | |
| class="org.springframework.beans.factory.config.PropertiesFactoryBean"> | |
| <property name="singleton" value="true" /> | |
| <property name="ignoreResourceNotFound" value="true" /> | |
| <property name="locations"> | |
| <list> | |
| <value>classpath:/usergrid-default.properties</value> | |
| <value>classpath:/usergrid-test.properties</value> | |
| <value>${usergrid-custom-spring-test-properties}</value> | |
| </list> | |
| </property> | |
| </bean> | |
| <bean id="propertyPlaceholderConfigurer" | |
| class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> | |
| <property name="properties" ref="properties" /> | |
| <property name="systemPropertiesModeName"> | |
| <value>SYSTEM_PROPERTIES_MODE_OVERRIDE</value> | |
| </property> | |
| </bean> | |
| <bean id="cassandraUseRemote" class="java.lang.Boolean"> | |
| <constructor-arg value="${cassandra.use_remote}" /> | |
| </bean> | |
| <bean id="cassandraLocalUrl" class="java.lang.String"> | |
| <constructor-arg value="${cassandra.local.url}" /> | |
| </bean> | |
| <bean id="cassandraRemoteUrl" class="java.lang.String"> | |
| <constructor-arg value="${cassandra.remote.url}" /> | |
| </bean> | |
| <bean id="cassandraUrl" class="java.lang.String"> | |
| <constructor-arg | |
| value="#{cassandraUseRemote ? cassandraRemoteUrl : cassandraLocalUrl}" /> | |
| </bean> | |
| <util:map id="cassandraCredentials" map-class="java.util.HashMap"> | |
| <entry key="username" value="${cassandra.username}" /> | |
| <entry key="password" value="${cassandra.password}" /> | |
| </util:map> | |
| <bean id="realm" class="org.apache.usergrid.security.shiro.Realm"> | |
| <property name="name" value="realm" /> | |
| </bean> | |
| <bean id="securityManager" class="org.apache.shiro.mgt.DefaultSecurityManager"> | |
| <property name="realm" ref="realm" /> | |
| </bean> | |
| <bean id="lifecycleBeanPostProcessor" class="org.apache.shiro.spring.LifecycleBeanPostProcessor"/> | |
| <bean | |
| class="org.springframework.beans.factory.config.MethodInvokingFactoryBean"> | |
| <property name="staticMethod" | |
| value="org.apache.shiro.SecurityUtils.setSecurityManager" /> | |
| <property name="arguments" ref="securityManager" /> | |
| </bean> | |
| <!-- The Time Resolution used for the cluster --> | |
| <bean id="microsecondsTimeResolution" | |
| class="me.prettyprint.cassandra.service.clock.MicrosecondsClockResolution" /> | |
| <bean id="cassandraHostConfigurator" | |
| class="me.prettyprint.cassandra.service.CassandraHostConfigurator"> | |
| <constructor-arg ref="cassandraUrl" /> | |
| <property name="clockResolution" ref="microsecondsTimeResolution" /> | |
| </bean> | |
| <bean id="cassandraCluster" class="me.prettyprint.cassandra.service.ThriftCluster"> | |
| <constructor-arg value="${cassandra.cluster}" /> | |
| <constructor-arg ref="cassandraHostConfigurator" /> | |
| <constructor-arg ref="cassandraCredentials" /> | |
| </bean> | |
| <!-- bean name="lockManager" class="org.apache.usergrid.locking.zookeeper.ZooKeeperLockManagerImpl" /> --> | |
| <bean name="lockManager" class="org.apache.usergrid.locking.zookeeper.NoOpLockManagerImpl" /> | |
| <bean id="cassandraService" | |
| class="org.apache.usergrid.persistence.cassandra.CassandraService" init-method="init"> | |
| <constructor-arg ref="properties" /> | |
| <constructor-arg ref="cassandraCluster" /> | |
| <constructor-arg ref="cassandraHostConfigurator" /> | |
| <constructor-arg ref="lockManager" /> | |
| </bean> | |
| <bean id="entityManagerFactory" | |
| class="org.apache.usergrid.persistence.cassandra.EntityManagerFactoryImpl"> | |
| <constructor-arg ref="cassandraService" /> | |
| </bean> | |
| <bean id="queueManagerFactory" | |
| class="org.apache.usergrid.mq.cassandra.QueueManagerFactoryImpl"> | |
| <constructor-arg ref="cassandraService" /> | |
| </bean> | |
| <bean id="serviceManagerFactory" class="org.apache.usergrid.services.ServiceManagerFactory"> | |
| <constructor-arg> | |
| <ref bean="entityManagerFactory" /> | |
| </constructor-arg> | |
| </bean> | |
| <bean id="tokenService" class="org.apache.usergrid.security.tokens.cassandra.TokenServiceImpl"/> | |
| <bean id="managementService" class="org.apache.usergrid.management.cassandra.ManagementServiceImpl" /> | |
| </beans> |