-
Notifications
You must be signed in to change notification settings - Fork 477
/
common-test-context.xml
157 lines (118 loc) · 8.95 KB
/
common-test-context.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2014-2016 CyberVision, Inc.
Licensed 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:security="http://www.springframework.org/schema/security"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context"
xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:task="http://www.springframework.org/schema/task" xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.2.xsd">
<aop:aspectj-autoproxy />
<context:component-scan base-package="org.kaaproject.kaa.server.node, org.kaaproject.kaa.server.control, org.kaaproject.kaa.server.bootstrap, org.kaaproject.kaa.server.operations" />
<import resource="classpath:/dao/mongodb-dao-test-context.xml" />
<util:properties id="properties"
location="classpath:/kaa-node-test.properties" />
<!-- Node configuration from properties file -->
<bean id="kaaNodeServerConfig" class="org.kaaproject.kaa.server.node.service.config.KaaNodeServerConfig">
<property name="controlServiceEnabled" value="#{properties[control_service_enabled]}" />
<property name="bootstrapServiceEnabled" value="#{properties[bootstrap_service_enabled]}" />
<property name="operationsServiceEnabled" value="#{properties[operations_service_enabled]}" />
<property name="thriftHost" value="#{properties[thrift_host]}" />
<property name="thriftPort" value="#{properties[thrift_port]}" />
<property name="zkEnabled" value="#{properties[zk_enabled]}" />
<property name="zkHostPortList" value="#{properties[zk_host_port_list]}" />
<property name="zkWaitConnectionTime" value="#{properties[zk_wait_connection_time]}" />
<property name="zkMaxRetryTime" value="#{properties[zk_max_retry_time]}" />
<property name="zkSleepTime" value="#{properties[zk_sleep_time]}" />
<property name="zkIgnoreErrors" value="#{properties[zk_ignore_errors]}" />
</bean>
<!--Zookeeper client configuration-->
<bean id="zkRetryPolicy" class="org.apache.curator.retry.RetryUntilElapsed">
<constructor-arg name="maxElapsedTimeMs" value="#{properties[zk_max_retry_time]}"/>
<constructor-arg name="sleepMsBetweenRetries" value="#{properties[zk_sleep_time]}"/>
</bean>
<bean id="zkClient" class="org.apache.curator.framework.CuratorFrameworkFactory" factory-method="newClient">
<constructor-arg name="connectString" value="#{properties[zk_host_port_list]}"/>
<constructor-arg name="sessionTimeoutMs" value="60000"/>
<constructor-arg name="connectionTimeoutMs" value="3000"/>
<constructor-arg name="retryPolicy" ref="zkRetryPolicy"/>
</bean>
<!-- Kaa Node Service -->
<bean id="kaaNodeInitializationService"
class="org.kaaproject.kaa.server.node.service.initialization.KaaNodeInitializationService" />
<!-- Control Service -->
<bean id="controlInitializationService"
class="org.kaaproject.kaa.server.control.service.initialization.ControlInitializationService" />
<bean id="controlService" class="org.kaaproject.kaa.server.control.service.DefaultControlService" />
<!-- Bootstrap Service -->
<bean id="bootstrapInitializationService" class="org.kaaproject.kaa.server.bootstrap.service.initialization.BootstrapInitializationService" />
<bean id="operationsServerListService" class="org.kaaproject.kaa.server.bootstrap.service.DefaultOperationsServerListService" />
<bean id="bootstrapKeyStoreService" class="org.kaaproject.kaa.server.bootstrap.service.security.BootstrapFileKeyStoreService" />
<!-- Operations Service -->
<bean id="operationsInitializationService" class="org.kaaproject.kaa.server.operations.service.initialization.OperationsInitializationService" />
<bean id="operationsService" class="org.kaaproject.kaa.server.operations.service.DefaultOperationsService" />
<bean id="deltaService" class="org.kaaproject.kaa.server.operations.service.delta.DefaultDeltaService" />
<bean id="cacheService" class="org.kaaproject.kaa.server.operations.service.cache.concurrent.ConcurrentCacheService" />
<bean id="profileService" class="org.kaaproject.kaa.server.operations.service.profile.DefaultProfileService" />
<bean id="deltaCalculatorFactory" class="org.kaaproject.kaa.server.common.core.algorithms.delta.DefaultDeltaCalculatorFactory" />
<bean id="operationsKeyStoreService" class="org.kaaproject.kaa.server.operations.service.security.OperationsFileKeyStoreService" />
<bean id="endpointUserService" class="org.kaaproject.kaa.server.operations.service.user.DefaultEndpointUserService" />
<bean id="logAppenderService" class="org.kaaproject.kaa.server.operations.service.logs.DefaultLogAppenderService" />
<!-- Configuration from properties file -->
<bean id="operationsServerConfig" class="org.kaaproject.kaa.server.operations.service.config.OperationsServerConfig">
<property name="userHashPartitions" value="#{properties[user_hash_partitions]}" />
<property name="maxNumberNeighborConnections" value="#{properties[max_number_neighbor_connections]}" />
</bean>
<!-- MISC -->
<bean id="configurationOverrideFactory" class="org.kaaproject.kaa.server.common.core.algorithms.override.DefaultOverrideAlgorithmFactory" />
<!-- JMX -->
<bean id="mbeanServer" class="org.springframework.jmx.support.MBeanServerFactoryBean">
<property name="locateExistingServerIfPossible" value="true" />
</bean>
<!-- EHCACHE -->
<bean id="ehcache" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean" p:config-location="ehcache.xml" />
<bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheCacheManager" p:cache-manager-ref="ehcache" />
<bean id="ehcacheManager" factory-bean="cacheManager" factory-method="getCacheManager" />
<bean id="managementService" class="net.sf.ehcache.management.ManagementService" init-method="init" destroy-method="dispose">
<constructor-arg ref="ehcacheManager" />
<constructor-arg ref="mbeanServer" />
<constructor-arg index="2" value="true" />
<constructor-arg index="3" value="true" />
<constructor-arg index="4" value="true" />
<constructor-arg index="5" value="true" />
</bean>
<!-- Log Appenders -->
<bean id="logAppenderResolver" class="org.kaaproject.kaa.server.operations.service.logs.DefaultLogAppenderBuilder" />
<bean id="metricsService" class="org.kaaproject.kaa.server.operations.service.metrics.DefaultMerticsService" init-method="startReport" destroy-method="stopReport">
<property name="enabled" value="#{properties[metrics_enabled]}"/>
</bean>
<bean id="trustfulCredentialsServiceLocator" class="org.kaaproject.kaa.server.node.service.credentials.InternalCredentialsServiceLocator">
<constructor-arg ref="trustfulCredentialsService"/>
</bean>
<bean id="internalCredentialsServiceLocator" class="org.kaaproject.kaa.server.node.service.credentials.InternalCredentialsServiceLocator">
<constructor-arg ref="internalCredentialsService"/>
</bean>
<util:map id="credentialsServiceLocatorMap">
<entry key="Trustful" value-ref="trustfulCredentialsServiceLocator"/>
<entry key="Internal" value-ref="internalCredentialsServiceLocator"/>
</util:map>
</beans>