1 |
| |
2 |
| |
3 |
| |
4 |
| |
5 |
| |
6 |
| |
7 |
| |
8 |
| |
9 |
| |
10 |
| |
11 |
| |
12 |
| |
13 |
| |
14 |
| |
15 |
| |
16 |
| |
17 |
| |
18 |
| |
19 |
| |
20 |
| |
21 |
| |
22 |
| |
23 |
| package org.jboss.cache.jmx; |
24 |
| |
25 |
| import org.jboss.cache.Version; |
26 |
| import org.jboss.cache.config.BuddyReplicationConfig; |
27 |
| import org.jboss.cache.config.BuddyReplicationConfig.BuddyLocatorConfig; |
28 |
| import org.jboss.cache.config.CacheLoaderConfig; |
29 |
| import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig; |
30 |
| import org.jboss.cache.config.Configuration; |
31 |
| import org.jboss.cache.config.Configuration.CacheMode; |
32 |
| import org.jboss.cache.config.Configuration.NodeLockingScheme; |
33 |
| import org.jboss.cache.config.EvictionConfig; |
34 |
| import org.jboss.cache.config.EvictionRegionConfig; |
35 |
| import org.jboss.cache.config.RuntimeConfig; |
36 |
| import org.jboss.cache.eviction.FIFOConfiguration; |
37 |
| import org.jboss.cache.eviction.FIFOPolicy; |
38 |
| import org.jboss.cache.eviction.LRUConfiguration; |
39 |
| import org.jboss.cache.eviction.LRUPolicy; |
40 |
| import org.jboss.cache.eviction.MRUConfiguration; |
41 |
| import org.jboss.cache.eviction.MRUPolicy; |
42 |
| import org.jboss.cache.loader.FileCacheLoader; |
43 |
| import org.jboss.cache.loader.jdbm.JdbmCacheLoader; |
44 |
| import org.jboss.cache.lock.IsolationLevel; |
45 |
| import org.jboss.cache.multiplexer.MultiplexerTestHelper; |
46 |
| import org.jboss.cache.transaction.BatchModeTransactionManagerLookup; |
47 |
| import org.jboss.cache.xml.XmlHelper; |
48 |
| import org.jgroups.ChannelFactory; |
49 |
| import org.jgroups.JChannelFactory; |
50 |
| import org.jgroups.jmx.JChannelFactoryMBean; |
51 |
| import org.w3c.dom.Element; |
52 |
| |
53 |
| import javax.management.MBeanServerInvocationHandler; |
54 |
| import javax.management.ObjectName; |
55 |
| import javax.transaction.TransactionManager; |
56 |
| import java.lang.reflect.InvocationHandler; |
57 |
| import java.lang.reflect.Method; |
58 |
| import java.lang.reflect.Proxy; |
59 |
| import java.util.List; |
60 |
| import java.util.Properties; |
61 |
| |
62 |
| |
63 |
| |
64 |
| |
65 |
| |
66 |
| |
67 |
| |
68 |
| public class LegacyConfigurationTest extends CacheJmxWrapperTestBase |
69 |
| { |
70 |
1
| public void testLocalCache() throws Exception
|
71 |
| { |
72 |
1
| CacheJmxWrapperMBean wrapper = new CacheJmxWrapper();
|
73 |
1
| registerWrapper(wrapper);
|
74 |
| |
75 |
1
| wrapper = (CacheJmxWrapperMBean) MBeanServerInvocationHandler.newProxyInstance(mBeanServer, mBeanName, CacheJmxWrapperMBean.class, false);
|
76 |
| |
77 |
1
| wrapper.setBuddyReplicationConfig(getBuddyReplicationConfig());
|
78 |
1
| wrapper.setCacheLoaderConfig(getCacheLoaderConfig());
|
79 |
1
| wrapper.setCacheMode("REPL_SYNC");
|
80 |
1
| wrapper.setClusterName("LocalTest");
|
81 |
1
| wrapper.setClusterConfig(getClusterConfig());
|
82 |
1
| wrapper.setEvictionPolicyConfig(getEvictionPolicyConfig());
|
83 |
1
| wrapper.setFetchInMemoryState(false);
|
84 |
1
| wrapper.setInitialStateRetrievalTimeout(100);
|
85 |
1
| wrapper.setInactiveOnStartup(true);
|
86 |
1
| wrapper.setNodeLockingScheme("OPTIMISTIC");
|
87 |
1
| wrapper.setIsolationLevel("READ_UNCOMMITTED");
|
88 |
1
| wrapper.setLockAcquisitionTimeout(200);
|
89 |
1
| wrapper.setReplicationVersion("1.0.1");
|
90 |
1
| wrapper.setReplQueueInterval(15);
|
91 |
1
| wrapper.setReplQueueMaxElements(50);
|
92 |
1
| wrapper.setSyncReplTimeout(300);
|
93 |
1
| wrapper.setSyncCommitPhase(true);
|
94 |
1
| wrapper.setSyncRollbackPhase(true);
|
95 |
1
| wrapper.setTransactionManagerLookupClass(BatchModeTransactionManagerLookup.class.getName());
|
96 |
1
| wrapper.setExposeManagementStatistics(false);
|
97 |
1
| wrapper.setUseRegionBasedMarshalling(true);
|
98 |
1
| wrapper.setUseReplQueue(true);
|
99 |
| |
100 |
1
| Configuration c = wrapper.getConfiguration();
|
101 |
| |
102 |
1
| assertEquals("CacheMode", "REPL_SYNC", wrapper.getCacheMode());
|
103 |
1
| assertEquals("CacheMode", CacheMode.REPL_SYNC, c.getCacheMode());
|
104 |
1
| assertEquals("ClusterName", "LocalTest", wrapper.getClusterName());
|
105 |
1
| assertEquals("ClusterName", "LocalTest", c.getClusterName());
|
106 |
1
| assertEquals("FetchInMemoryState", false, wrapper.getFetchInMemoryState());
|
107 |
1
| assertEquals("FetchInMemoryState", false, c.isFetchInMemoryState());
|
108 |
1
| assertEquals("InitialStateRetrievalTimeout", 100, wrapper.getInitialStateRetrievalTimeout());
|
109 |
1
| assertEquals("InitialStateRetrievalTimeout", 100, c.getStateRetrievalTimeout());
|
110 |
1
| assertEquals("InactiveOnStartup", true, wrapper.isInactiveOnStartup());
|
111 |
1
| assertEquals("InactiveOnStartup", true, c.isInactiveOnStartup());
|
112 |
1
| assertEquals("NodeLockingScheme", "OPTIMISTIC", wrapper.getNodeLockingScheme());
|
113 |
1
| assertEquals("NodeLockingScheme", NodeLockingScheme.OPTIMISTIC, c.getNodeLockingScheme());
|
114 |
1
| assertEquals("IsolationLevel", "READ_UNCOMMITTED", wrapper.getIsolationLevel());
|
115 |
1
| assertEquals("IsolationLevel", IsolationLevel.READ_UNCOMMITTED, c.getIsolationLevel());
|
116 |
1
| assertEquals("LockAcquisitionTimeout", 200, wrapper.getLockAcquisitionTimeout());
|
117 |
1
| assertEquals("LockAcquisitionTimeout", 200, c.getLockAcquisitionTimeout());
|
118 |
1
| assertEquals("ReplicationVersion", "1.0.1", wrapper.getReplicationVersion());
|
119 |
1
| assertEquals("ReplicationVersion", Version.getVersionShort("1.0.1"), c.getReplicationVersion());
|
120 |
1
| assertEquals("ReplQueueInterval", 15, wrapper.getReplQueueInterval());
|
121 |
1
| assertEquals("ReplQueueInterval", 15, c.getReplQueueInterval());
|
122 |
1
| assertEquals("ReplQueueMaxElements", 50, wrapper.getReplQueueMaxElements());
|
123 |
1
| assertEquals("ReplQueueMaxElements", 50, c.getReplQueueMaxElements());
|
124 |
1
| assertEquals("SyncReplTimeout", 300, wrapper.getSyncReplTimeout());
|
125 |
1
| assertEquals("SyncReplTimeout", 300, c.getSyncReplTimeout());
|
126 |
1
| assertEquals("SyncCommitPhase", true, wrapper.getSyncCommitPhase());
|
127 |
1
| assertEquals("SyncCommitPhase", true, c.isSyncCommitPhase());
|
128 |
1
| assertEquals("SyncRollbackPhase", true, wrapper.getSyncRollbackPhase());
|
129 |
1
| assertEquals("SyncRollbackPhase", true, c.isSyncRollbackPhase());
|
130 |
1
| assertEquals("TransactionManagerLookupClass", BatchModeTransactionManagerLookup.class.getName(), wrapper.getTransactionManagerLookupClass());
|
131 |
1
| assertEquals("TransactionManagerLookupClass", BatchModeTransactionManagerLookup.class.getName(), c.getTransactionManagerLookupClass());
|
132 |
1
| assertEquals("ExposeManagementStatistics", false, wrapper.getExposeManagementStatistics());
|
133 |
1
| assertEquals("ExposeManagementStatistics", false, c.getExposeManagementStatistics());
|
134 |
1
| assertEquals("UseRegionBasedMarshalling", true, wrapper.getUseRegionBasedMarshalling());
|
135 |
1
| assertEquals("UseRegionBasedMarshalling", true, c.isUseRegionBasedMarshalling());
|
136 |
1
| assertEquals("UseReplQueue", true, wrapper.getUseReplQueue());
|
137 |
1
| assertEquals("UseReplQueue", true, c.isUseReplQueue());
|
138 |
| |
139 |
1
| assertEquals("ClusterConfig", getClusterConfig().toString(), wrapper.getClusterConfig().toString());
|
140 |
| |
141 |
1
| assertEquals("BuddyReplicationConfig", getBuddyReplicationConfig().toString(), wrapper.getBuddyReplicationConfig().toString());
|
142 |
1
| BuddyReplicationConfig brc = c.getBuddyReplicationConfig();
|
143 |
1
| assertEquals("BR enabled", true, brc.isEnabled());
|
144 |
1
| assertEquals("BR auto grav", false, brc.isAutoDataGravitation());
|
145 |
1
| assertEquals("BR remove find", false, brc.isDataGravitationRemoveOnFind());
|
146 |
1
| assertEquals("BR search backup", false, brc.isDataGravitationSearchBackupTrees());
|
147 |
1
| assertEquals("BR comm timeout", 600000, brc.getBuddyCommunicationTimeout());
|
148 |
1
| assertEquals("BR poolname", "testpool", brc.getBuddyPoolName());
|
149 |
1
| BuddyLocatorConfig blc = brc.getBuddyLocatorConfig();
|
150 |
1
| assertEquals("BR locator", "org.jboss.cache.buddyreplication.TestBuddyLocator", blc.getBuddyLocatorClass());
|
151 |
1
| Properties props = blc.getBuddyLocatorProperties();
|
152 |
1
| assertEquals("BR props", "2", props.get("numBuddies"));
|
153 |
| |
154 |
1
| assertEquals("CacheLoaderConfig", getCacheLoaderConfig().toString(), wrapper.getCacheLoaderConfig().toString());
|
155 |
1
| CacheLoaderConfig clc = c.getCacheLoaderConfig();
|
156 |
1
| assertEquals("CL passivation", false, clc.isPassivation());
|
157 |
1
| assertEquals("CL passivation", true, clc.isShared());
|
158 |
1
| assertEquals("CL preload", "/foo", clc.getPreload());
|
159 |
1
| List<IndividualCacheLoaderConfig> iclcs = clc.getIndividualCacheLoaderConfigs();
|
160 |
1
| IndividualCacheLoaderConfig iclc = iclcs.get(0);
|
161 |
1
| assertEquals("CL0 class", FileCacheLoader.class.getName(), iclc.getClassName());
|
162 |
1
| assertEquals("CL0 async", false, iclc.isAsync());
|
163 |
1
| assertEquals("CL0 fetch", true, iclc.isFetchPersistentState());
|
164 |
1
| assertEquals("CL0 ignore", true, iclc.isIgnoreModifications());
|
165 |
1
| assertEquals("CL0 purge", true, iclc.isPurgeOnStartup());
|
166 |
1
| assertEquals("CL0 push", true, iclc.isPushStateWhenCoordinator());
|
167 |
1
| assertEquals("CL0 singleton", true, iclc.isSingletonStore());
|
168 |
1
| iclc = iclcs.get(1);
|
169 |
1
| assertEquals("CL1 class", JdbmCacheLoader.class.getName(), iclc.getClassName());
|
170 |
1
| assertEquals("CL1 async", true, iclc.isAsync());
|
171 |
1
| assertEquals("CL1 fetch", false, iclc.isFetchPersistentState());
|
172 |
1
| assertEquals("CL1 ignore", false, iclc.isIgnoreModifications());
|
173 |
1
| assertEquals("CL1 purge", false, iclc.isPurgeOnStartup());
|
174 |
1
| assertEquals("CL1 push", false, iclc.isPushStateWhenCoordinator());
|
175 |
1
| assertEquals("CL1 singleton", false, iclc.isSingletonStore());
|
176 |
| |
177 |
1
| assertEquals("EvictionPolicyConfig", getEvictionPolicyConfig().toString(), wrapper.getEvictionPolicyConfig().toString());
|
178 |
1
| EvictionConfig ec = c.getEvictionConfig();
|
179 |
1
| assertEquals("EC queue size", 20000, ec.getDefaultEventQueueSize());
|
180 |
1
| assertEquals("EC wakeup", 5, ec.getWakeupIntervalSeconds());
|
181 |
1
| assertEquals("EC default pol", LRUPolicy.class.getName(), ec.getDefaultEvictionPolicyClass());
|
182 |
1
| List<EvictionRegionConfig> ercs = ec.getEvictionRegionConfigs();
|
183 |
1
| EvictionRegionConfig erc = ercs.get(0);
|
184 |
1
| assertEquals("ERC0 name", "/_default_", erc.getRegionName());
|
185 |
1
| assertEquals("ERC0 queue size", 1000, erc.getEventQueueSize());
|
186 |
1
| LRUConfiguration lru = (LRUConfiguration) erc.getEvictionPolicyConfig();
|
187 |
1
| assertEquals("EPC0 pol", LRUPolicy.class.getName(), lru.getEvictionPolicyClass());
|
188 |
1
| assertEquals("EPC0 maxnodes", 5000, lru.getMaxNodes());
|
189 |
1
| assertEquals("EPC0 ttl", 1000, lru.getTimeToLiveSeconds());
|
190 |
1
| erc = ercs.get(1);
|
191 |
1
| assertEquals("ERC1 name", "/org/jboss/data", erc.getRegionName());
|
192 |
1
| assertEquals("ERC1 queue size", 20000, erc.getEventQueueSize());
|
193 |
1
| FIFOConfiguration fifo = (FIFOConfiguration) erc.getEvictionPolicyConfig();
|
194 |
1
| assertEquals("EPC1 pol", FIFOPolicy.class.getName(), fifo.getEvictionPolicyClass());
|
195 |
1
| assertEquals("EPC1 maxnodes", 5000, fifo.getMaxNodes());
|
196 |
1
| erc = ercs.get(2);
|
197 |
1
| assertEquals("ERC2 name", "/test", erc.getRegionName());
|
198 |
1
| assertEquals("ERC2 queue size", 20000, erc.getEventQueueSize());
|
199 |
1
| MRUConfiguration mru = (MRUConfiguration) erc.getEvictionPolicyConfig();
|
200 |
1
| assertEquals("EPC2 pol", MRUPolicy.class.getName(), mru.getEvictionPolicyClass());
|
201 |
1
| assertEquals("EPC2 maxnodes", 10000, mru.getMaxNodes());
|
202 |
1
| erc = ercs.get(3);
|
203 |
1
| assertEquals("ERC3 name", "/maxAgeTest", erc.getRegionName());
|
204 |
1
| assertEquals("ERC3 queue size", 20000, erc.getEventQueueSize());
|
205 |
1
| lru = (LRUConfiguration) erc.getEvictionPolicyConfig();
|
206 |
1
| assertEquals("EPC3 pol", LRUPolicy.class.getName(), lru.getEvictionPolicyClass());
|
207 |
1
| assertEquals("EPC3 maxnodes", 10000, lru.getMaxNodes());
|
208 |
1
| assertEquals("EPC3 maxage", 10, lru.getMaxAgeSeconds());
|
209 |
1
| assertEquals("EPC3 ttl", 8, lru.getTimeToLiveSeconds());
|
210 |
| |
211 |
| } |
212 |
| |
213 |
1
| public void testRuntimeConfig() throws Exception
|
214 |
| { |
215 |
1
| CacheJmxWrapperMBean wrapper = new CacheJmxWrapper();
|
216 |
1
| registerWrapper(wrapper);
|
217 |
| |
218 |
1
| wrapper = (CacheJmxWrapperMBean) MBeanServerInvocationHandler.newProxyInstance(mBeanServer, mBeanName, CacheJmxWrapperMBean.class, false);
|
219 |
| |
220 |
| |
221 |
1
| TransactionManager tm = (TransactionManager) Proxy.newProxyInstance(getClass().getClassLoader(),
|
222 |
| new Class[]{TransactionManager.class}, new MockInvocationHandler()); |
223 |
1
| wrapper.setTransactionManager(tm);
|
224 |
1
| ChannelFactory cf = new JChannelFactory();
|
225 |
1
| wrapper.setMuxChannelFactory(cf);
|
226 |
| |
227 |
1
| RuntimeConfig rc = wrapper.getConfiguration().getRuntimeConfig();
|
228 |
| |
229 |
1
| assertSame("Same TM", tm, wrapper.getTransactionManager());
|
230 |
1
| assertSame("Same TM", tm, rc.getTransactionManager());
|
231 |
1
| assertSame("Same ChannelFactory", cf, wrapper.getMuxChannelFactory());
|
232 |
1
| assertSame("Same ChannelFactory", cf, rc.getMuxChannelFactory());
|
233 |
| } |
234 |
| |
235 |
1
| public void testLegacyMuxChannelCreation() throws Exception
|
236 |
| { |
237 |
1
| CacheJmxWrapperMBean wrapper = new CacheJmxWrapper();
|
238 |
1
| registerWrapper(wrapper);
|
239 |
| |
240 |
1
| wrapper = (CacheJmxWrapperMBean) MBeanServerInvocationHandler.newProxyInstance(mBeanServer, mBeanName, CacheJmxWrapperMBean.class, false);
|
241 |
1
| wrapper.setMultiplexerStack(MultiplexerTestHelper.MUX_STACK);
|
242 |
| |
243 |
1
| JChannelFactory factory = new JChannelFactory();
|
244 |
1
| factory.setDomain("jbc.mux.test");
|
245 |
1
| factory.setExposeChannels(false);
|
246 |
1
| factory.setMultiplexerConfig(MultiplexerTestHelper.getClusterConfigElement(getDefaultProperties()));
|
247 |
| |
248 |
1
| ObjectName on = new ObjectName("jgroups:service=Mux");
|
249 |
1
| mBeanServer.registerMBean(new org.jgroups.jmx.JChannelFactory(factory), on);
|
250 |
| |
251 |
1
| wrapper.setMultiplexerService((JChannelFactoryMBean) MBeanServerInvocationHandler.newProxyInstance(mBeanServer, on, JChannelFactoryMBean.class, false));
|
252 |
| |
253 |
1
| wrapper.start();
|
254 |
| |
255 |
1
| RuntimeConfig rc = wrapper.getConfiguration().getRuntimeConfig();
|
256 |
1
| assertNotNull("Channel created", rc.getChannel());
|
257 |
| } |
258 |
| |
259 |
2
| protected static Element getBuddyReplicationConfig() throws Exception
|
260 |
| { |
261 |
2
| String xmlString = "<config><buddyReplicationEnabled>true</buddyReplicationEnabled>\n" +
|
262 |
| " <buddyCommunicationTimeout>600000</buddyCommunicationTimeout>\n" + |
263 |
| " <buddyLocatorClass>org.jboss.cache.buddyreplication.TestBuddyLocator</buddyLocatorClass>\n" + |
264 |
| " <buddyLocatorProperties>numBuddies = 2</buddyLocatorProperties>\n" + |
265 |
| " <buddyPoolName>testpool</buddyPoolName>" + |
266 |
| " <autoDataGravitation>false</autoDataGravitation>\n" + |
267 |
| " <dataGravitationRemoveOnFind>false</dataGravitationRemoveOnFind>\n" + |
268 |
| " <dataGravitationSearchBackupTrees>false</dataGravitationSearchBackupTrees>" + |
269 |
| "</config>"; |
270 |
2
| return XmlHelper.stringToElement(xmlString);
|
271 |
| } |
272 |
| |
273 |
2
| protected static Element getCacheLoaderConfig() throws Exception
|
274 |
| { |
275 |
2
| String xml = "<config>\n" +
|
276 |
| "<passivation>false</passivation>\n" + |
277 |
| "<preload>/foo</preload>\n" + |
278 |
| "<shared>true</shared>\n" + |
279 |
| "<cacheloader>\n" + |
280 |
| "<class>org.jboss.cache.loader.FileCacheLoader</class>\n" + |
281 |
| "<properties>" + |
282 |
| " location=/tmp\n" + |
283 |
| "</properties>\n" + |
284 |
| "<async>false</async>\n" + |
285 |
| "<fetchPersistentState>true</fetchPersistentState>\n" + |
286 |
| "<ignoreModifications>true</ignoreModifications>\n" + |
287 |
| "<purgeOnStartup>true</purgeOnStartup>\n" + |
288 |
| "<singletonStore pushStateWhenCoordinator=\"true\">true</singletonStore>\n" + |
289 |
| "</cacheloader>\n" + |
290 |
| "<cacheloader>\n" + |
291 |
| "<class>org.jboss.cache.loader.jdbm.JdbmCacheLoader</class>\n" + |
292 |
| "<properties>" + |
293 |
| " location=/home/bstansberry\n" + |
294 |
| "</properties>\n" + |
295 |
| "<async>true</async>\n" + |
296 |
| "<fetchPersistentState>false</fetchPersistentState>\n" + |
297 |
| "<ignoreModifications>false</ignoreModifications>\n" + |
298 |
| "<purgeOnStartup>false</purgeOnStartup>\n" + |
299 |
| "<singletonStore pushStateWhenCoordinator=\"false\">false</singletonStore>\n" + |
300 |
| "</cacheloader>\n" + |
301 |
| "</config>"; |
302 |
2
| return XmlHelper.stringToElement(xml);
|
303 |
| } |
304 |
| |
305 |
2
| protected static Element getEvictionPolicyConfig() throws Exception
|
306 |
| { |
307 |
2
| String xml = "<config>\n" +
|
308 |
| "<attribute name=\"wakeUpIntervalSeconds\">5</attribute>\n" + |
309 |
| "<attribute name=\"eventQueueSize\">20000</attribute>\n" + |
310 |
| "<attribute name=\"policyClass\">org.jboss.cache.eviction.LRUPolicy</attribute>\n" + |
311 |
| "<region name=\"/_default_\" eventQueueSize=\"1000\">\n" + |
312 |
| " <attribute name=\"maxNodes\">5000</attribute>\n" + |
313 |
| " <attribute name=\"timeToLiveSeconds\">1000</attribute>\n" + |
314 |
| "</region>\n" + |
315 |
| "<region name=\"/org/jboss/data\" policyClass=\"org.jboss.cache.eviction.FIFOPolicy\">\n" + |
316 |
| " <attribute name=\"maxNodes\">5000</attribute>\n" + |
317 |
| "</region>\n" + |
318 |
| "<region name=\"/test/\" policyClass=\"org.jboss.cache.eviction.MRUPolicy\">\n" + |
319 |
| " <attribute name=\"maxNodes\">10000</attribute>\n" + |
320 |
| "</region>\n" + |
321 |
| "<region name=\"/maxAgeTest/\">\n" + |
322 |
| " <attribute name=\"maxNodes\">10000</attribute>\n" + |
323 |
| " <attribute name=\"timeToLiveSeconds\">8</attribute>\n" + |
324 |
| " <attribute name=\"maxAgeSeconds\">10</attribute>\n" + |
325 |
| "</region>\n" + |
326 |
| " </config>\n"; |
327 |
2
| return XmlHelper.stringToElement(xml);
|
328 |
| } |
329 |
| |
330 |
2
| protected static Element getClusterConfig() throws Exception
|
331 |
| { |
332 |
2
| String xml =
|
333 |
| "<config>\n" + |
334 |
| " <UDP mcast_addr=\"228.10.10.10\"\n" + |
335 |
| " mcast_port=\"45588\"\n" + |
336 |
| " tos=\"8\"\n" + |
337 |
| " ucast_recv_buf_size=\"20000000\"\n" + |
338 |
| " ucast_send_buf_size=\"640000\"\n" + |
339 |
| " mcast_recv_buf_size=\"25000000\"\n" + |
340 |
| " mcast_send_buf_size=\"640000\"\n" + |
341 |
| " loopback=\"false\"\n" + |
342 |
| " discard_incompatible_packets=\"true\"\n" + |
343 |
| " max_bundle_size=\"64000\"\n" + |
344 |
| " max_bundle_timeout=\"30\"\n" + |
345 |
| " use_incoming_packet_handler=\"true\"\n" + |
346 |
| " ip_ttl=\"2\"\n" + |
347 |
| " enable_bundling=\"false\"\n" + |
348 |
| " enable_diagnostics=\"true\"\n" + |
349 |
| " use_concurrent_stack=\"true\"\n" + |
350 |
| " thread_naming_pattern=\"pl\"\n" + |
351 |
| " thread_pool.enabled=\"true\"\n" + |
352 |
| " thread_pool.min_threads=\"1\"\n" + |
353 |
| " thread_pool.max_threads=\"25\"\n" + |
354 |
| " thread_pool.keep_alive_time=\"30000\"\n" + |
355 |
| " thread_pool.queue_enabled=\"true\"\n" + |
356 |
| " thread_pool.queue_max_size=\"10\"\n" + |
357 |
| " thread_pool.rejection_policy=\"Run\"\n" + |
358 |
| " oob_thread_pool.enabled=\"true\"\n" + |
359 |
| " oob_thread_pool.min_threads=\"1\"\n" + |
360 |
| " oob_thread_pool.max_threads=\"4\"\n" + |
361 |
| " oob_thread_pool.keep_alive_time=\"10000\"\n" + |
362 |
| " oob_thread_pool.queue_enabled=\"true\"\n" + |
363 |
| " oob_thread_pool.queue_max_size=\"10\"\n" + |
364 |
| " oob_thread_pool.rejection_policy=\"Run\"/>\n" + |
365 |
| " <PING timeout=\"2000\" num_initial_members=\"3\"/>\n" + |
366 |
| " <MERGE2 max_interval=\"30000\" min_interval=\"10000\"/>\n" + |
367 |
| " <FD_SOCK/>\n" + |
368 |
| " <FD timeout=\"10000\" max_tries=\"5\" shun=\"true\"/>\n" + |
369 |
| " <VERIFY_SUSPECT timeout=\"1500\"/>\n" + |
370 |
| " <pbcast.NAKACK max_xmit_size=\"60000\"\n" + |
371 |
| " use_mcast_xmit=\"false\" gc_lag=\"0\"\n" + |
372 |
| " retransmit_timeout=\"300,600,1200,2400,4800\"\n" + |
373 |
| " discard_delivered_msgs=\"true\"/>\n" + |
374 |
| " <UNICAST timeout=\"300,600,1200,2400,3600\"/>\n" + |
375 |
| " <pbcast.STABLE stability_delay=\"1000\" desired_avg_gossip=\"50000\"\n" + |
376 |
| " max_bytes=\"400000\"/>\n" + |
377 |
| " <pbcast.GMS print_local_addr=\"true\" join_timeout=\"5000\"\n" + |
378 |
| " join_retry_timeout=\"2000\" shun=\"false\"\n" + |
379 |
| " view_bundling=\"true\" view_ack_collection_timeout=\"5000\"/>\n" + |
380 |
| " <FRAG2 frag_size=\"60000\"/>\n" + |
381 |
| " <pbcast.STREAMING_STATE_TRANSFER use_reading_thread=\"true\"/>\n" + |
382 |
| " <pbcast.FLUSH timeout=\"0\"/>\n" + |
383 |
| "</config>"; |
384 |
2
| return XmlHelper.stringToElement(xml);
|
385 |
| } |
386 |
| |
387 |
1
| protected String getDefaultProperties()
|
388 |
| { |
389 |
1
| return "UDP(mcast_addr=224.0.0.36;mcast_port=55566;ip_ttl=32;" +
|
390 |
| "mcast_send_buf_size=150000;mcast_recv_buf_size=80000):" + |
391 |
| "PING(timeout=1000;num_initial_members=2):" + |
392 |
| "MERGE2(min_interval=5000;max_interval=10000):" + |
393 |
| "FD_SOCK:" + |
394 |
| "VERIFY_SUSPECT(timeout=1500):" + |
395 |
| "pbcast.NAKACK(gc_lag=50;max_xmit_size=8192;retransmit_timeout=600,1200,2400,4800):" + |
396 |
| "UNICAST(timeout=600,1200,2400,4800):" + |
397 |
| "pbcast.STABLE(desired_avg_gossip=20000):" + |
398 |
| "FRAG(frag_size=8192;down_thread=false;up_thread=false):" + |
399 |
| "pbcast.GMS(join_timeout=5000;join_retry_timeout=2000;" + |
400 |
| "shun=false;print_local_addr=true):" + |
401 |
| "pbcast.STATE_TRANSFER"; |
402 |
| } |
403 |
| |
404 |
| class MockInvocationHandler implements InvocationHandler |
405 |
| { |
406 |
| |
407 |
0
| public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
|
408 |
| { |
409 |
0
| return null;
|
410 |
| } |
411 |
| |
412 |
| } |
413 |
| } |