1 |
| |
2 |
| |
3 |
| |
4 |
| |
5 |
| |
6 |
| |
7 |
| package org.jboss.cache.config; |
8 |
| |
9 |
| import org.jboss.cache.CacheImpl; |
10 |
| import org.jboss.cache.Version; |
11 |
| import org.jboss.cache.factories.XmlConfigurationParser; |
12 |
| import org.jboss.cache.lock.IsolationLevel; |
13 |
| import org.w3c.dom.Element; |
14 |
| |
15 |
| import java.util.Locale; |
16 |
| |
17 |
| |
18 |
| |
19 |
| |
20 |
| |
21 |
| |
22 |
| public class Configuration |
23 |
| extends ConfigurationComponent |
24 |
| implements Cloneable |
25 |
| { |
26 |
| private static final long serialVersionUID = 5553791890144997466L; |
27 |
| private int numberOfNotifierThreads = 25; |
28 |
| |
29 |
| |
30 |
| |
31 |
| |
32 |
| public enum CacheMode |
33 |
| { |
34 |
| |
35 |
| |
36 |
| |
37 |
| LOCAL, |
38 |
| |
39 |
| |
40 |
| |
41 |
| |
42 |
| REPL_SYNC, |
43 |
| |
44 |
| |
45 |
| |
46 |
| |
47 |
| REPL_ASYNC, |
48 |
| |
49 |
| |
50 |
| |
51 |
| |
52 |
| INVALIDATION_SYNC, |
53 |
| |
54 |
| |
55 |
| |
56 |
| |
57 |
| INVALIDATION_ASYNC |
58 |
| } |
59 |
| |
60 |
0
| public static CacheMode legacyModeToCacheMode(int legacyMode)
|
61 |
| { |
62 |
0
| switch (legacyMode)
|
63 |
| { |
64 |
0
| case 1:
|
65 |
0
| return CacheMode.LOCAL;
|
66 |
0
| case 2:
|
67 |
0
| return CacheMode.REPL_ASYNC;
|
68 |
0
| case 3:
|
69 |
0
| return CacheMode.REPL_SYNC;
|
70 |
0
| case 4:
|
71 |
0
| return CacheMode.INVALIDATION_ASYNC;
|
72 |
0
| case 5:
|
73 |
0
| return CacheMode.INVALIDATION_SYNC;
|
74 |
0
| default:
|
75 |
0
| throw new IllegalArgumentException("Unknown legacy cache mode " +
|
76 |
| legacyMode); |
77 |
| } |
78 |
| } |
79 |
| |
80 |
| |
81 |
| |
82 |
| |
83 |
| public enum NodeLockingScheme |
84 |
| { |
85 |
| |
86 |
| |
87 |
| |
88 |
| |
89 |
| |
90 |
| PESSIMISTIC, |
91 |
| |
92 |
| |
93 |
| |
94 |
| |
95 |
| |
96 |
| |
97 |
| OPTIMISTIC |
98 |
| } |
99 |
| |
100 |
| |
101 |
| |
102 |
| |
103 |
| public static final short DEFAULT_REPLICATION_VERSION = Version.getVersionShort(); |
104 |
| |
105 |
| |
106 |
| |
107 |
| |
108 |
| |
109 |
| private String clusterName = "JBossCache-Cluster"; |
110 |
| private String clusterConfig = null; |
111 |
| private boolean useReplQueue = false; |
112 |
| @Dynamic |
113 |
| private int replQueueMaxElements = 1000; |
114 |
| @Dynamic |
115 |
| private long replQueueInterval = 5000; |
116 |
| private boolean exposeManagementStatistics = true; |
117 |
| @Dynamic |
118 |
| private boolean fetchInMemoryState = true; |
119 |
| private short replicationVersion = DEFAULT_REPLICATION_VERSION; |
120 |
| @Dynamic |
121 |
| private long lockAcquisitionTimeout = 10000; |
122 |
| @Dynamic |
123 |
| private long syncReplTimeout = 15000; |
124 |
| private CacheMode cacheMode = CacheMode.LOCAL; |
125 |
| private boolean inactiveOnStartup = false; |
126 |
| @Dynamic |
127 |
| private long stateRetrievalTimeout = 10000; |
128 |
| private IsolationLevel isolationLevel = IsolationLevel.REPEATABLE_READ; |
129 |
| @Dynamic |
130 |
| private boolean lockParentForChildInsertRemove = false; |
131 |
| @Dynamic |
132 |
| private EvictionConfig evictionConfig = null; |
133 |
| private boolean useRegionBasedMarshalling = false; |
134 |
| private String transactionManagerLookupClass = null; |
135 |
| private CacheLoaderConfig cacheLoaderConfig = null; |
136 |
| @Dynamic |
137 |
| private boolean syncCommitPhase = false; |
138 |
| @Dynamic |
139 |
| private boolean syncRollbackPhase = false; |
140 |
| private BuddyReplicationConfig buddyReplicationConfig; |
141 |
| private boolean nodeLockingOptimistic = false; |
142 |
| private NodeLockingScheme nodeLockingScheme = NodeLockingScheme.PESSIMISTIC; |
143 |
| private String muxStackName = null; |
144 |
| private boolean usingMultiplexer = false; |
145 |
| private transient RuntimeConfig runtimeConfig; |
146 |
| private String marshallerClass = "org.jboss.cache.marshall.VersionAwareMarshaller"; |
147 |
| |
148 |
| |
149 |
| |
150 |
| |
151 |
| |
152 |
| |
153 |
| |
154 |
| |
155 |
| |
156 |
| |
157 |
2871
| public Configuration(CacheImpl cache)
|
158 |
| { |
159 |
2871
| setCacheImpl(cache);
|
160 |
| } |
161 |
| |
162 |
| |
163 |
| |
164 |
| |
165 |
3711
| public Configuration()
|
166 |
| { |
167 |
| } |
168 |
| |
169 |
| |
170 |
| |
171 |
| |
172 |
| |
173 |
| |
174 |
| |
175 |
| |
176 |
658
| public void setClusterConfig(Element config)
|
177 |
| { |
178 |
658
| setClusterConfig(XmlConfigurationParser.parseClusterConfigXml(config));
|
179 |
| } |
180 |
| |
181 |
1695
| public void setClusterName(String clusterName)
|
182 |
| { |
183 |
1695
| testImmutability("clusterName");
|
184 |
1695
| this.clusterName = clusterName;
|
185 |
| } |
186 |
| |
187 |
1083
| public void setClusterConfig(String clusterConfig)
|
188 |
| { |
189 |
1083
| testImmutability("clusterConfig");
|
190 |
1083
| this.clusterConfig = clusterConfig;
|
191 |
| } |
192 |
| |
193 |
669
| public void setReplQueueMaxElements(int replQueueMaxElements)
|
194 |
| { |
195 |
669
| testImmutability("replQueueMaxElements");
|
196 |
669
| this.replQueueMaxElements = replQueueMaxElements;
|
197 |
| } |
198 |
| |
199 |
669
| public void setReplQueueInterval(long replQueueInterval)
|
200 |
| { |
201 |
669
| testImmutability("replQueueInterval");
|
202 |
669
| this.replQueueInterval = replQueueInterval;
|
203 |
| } |
204 |
| |
205 |
102
| public void setExposeManagementStatistics(boolean useMbean)
|
206 |
| { |
207 |
102
| testImmutability("exposeManagementStatistics");
|
208 |
102
| this.exposeManagementStatistics = useMbean;
|
209 |
| } |
210 |
| |
211 |
857
| public void setFetchInMemoryState(boolean fetchInMemoryState)
|
212 |
| { |
213 |
857
| testImmutability("fetchInMemoryState");
|
214 |
857
| this.fetchInMemoryState = fetchInMemoryState;
|
215 |
| } |
216 |
| |
217 |
127
| public void setReplicationVersion(short replicationVersion)
|
218 |
| { |
219 |
127
| testImmutability("replicationVersion");
|
220 |
127
| this.replicationVersion = replicationVersion;
|
221 |
| } |
222 |
| |
223 |
127
| public void setReplVersionString(String replVersionString)
|
224 |
| { |
225 |
127
| setReplicationVersion(replVersionString == null ? 0 : Version.getVersionShort(replVersionString));
|
226 |
| } |
227 |
| |
228 |
1229
| public void setLockAcquisitionTimeout(long lockAcquisitionTimeout)
|
229 |
| { |
230 |
1229
| testImmutability("lockAcquisitionTimeout");
|
231 |
1229
| this.lockAcquisitionTimeout = lockAcquisitionTimeout;
|
232 |
| } |
233 |
| |
234 |
1066
| public void setSyncReplTimeout(long syncReplTimeout)
|
235 |
| { |
236 |
1066
| testImmutability("syncReplTimeout");
|
237 |
1066
| this.syncReplTimeout = syncReplTimeout;
|
238 |
| } |
239 |
| |
240 |
1942
| public void setCacheMode(CacheMode cacheModeInt)
|
241 |
| { |
242 |
1942
| testImmutability("cacheMode");
|
243 |
1940
| this.cacheMode = cacheModeInt;
|
244 |
| } |
245 |
| |
246 |
1413
| public void setCacheMode(String cacheMode)
|
247 |
| { |
248 |
1413
| testImmutability("cacheMode");
|
249 |
0
| if (cacheMode == null) throw new ConfigurationException("Cache mode cannot be null", "CacheMode");
|
250 |
1413
| this.cacheMode = CacheMode.valueOf(uc(cacheMode));
|
251 |
1413
| if (this.cacheMode == null)
|
252 |
| { |
253 |
0
| log.warn("Unknown cache mode '" + cacheMode + "', using defaults.");
|
254 |
0
| this.cacheMode = CacheMode.LOCAL;
|
255 |
| } |
256 |
| } |
257 |
| |
258 |
2
| public String getCacheModeString()
|
259 |
| { |
260 |
2
| return cacheMode == null ? null : cacheMode.toString();
|
261 |
| } |
262 |
| |
263 |
2
| public void setCacheModeString(String cacheMode)
|
264 |
| { |
265 |
2
| setCacheMode(cacheMode);
|
266 |
| } |
267 |
| |
268 |
71
| public void setInactiveOnStartup(boolean inactiveOnStartup)
|
269 |
| { |
270 |
71
| testImmutability("inactiveOnStartup");
|
271 |
71
| this.inactiveOnStartup = inactiveOnStartup;
|
272 |
| } |
273 |
| |
274 |
6846
| public EvictionConfig getEvictionConfig()
|
275 |
| { |
276 |
6846
| return evictionConfig;
|
277 |
| } |
278 |
| |
279 |
1663
| public void setEvictionConfig(EvictionConfig config)
|
280 |
| { |
281 |
1663
| testImmutability("evictionConfig");
|
282 |
1663
| this.evictionConfig = config;
|
283 |
| } |
284 |
| |
285 |
1124
| public void setUseRegionBasedMarshalling(boolean useRegionBasedMarshalling)
|
286 |
| { |
287 |
1124
| testImmutability("useRegionBasedMarshalling");
|
288 |
1124
| this.useRegionBasedMarshalling = useRegionBasedMarshalling;
|
289 |
| } |
290 |
| |
291 |
2780
| public void setTransactionManagerLookupClass(String transactionManagerLookupClass)
|
292 |
| { |
293 |
2780
| testImmutability("transactionManagerLookupClass");
|
294 |
2780
| this.transactionManagerLookupClass = transactionManagerLookupClass;
|
295 |
| } |
296 |
| |
297 |
2357
| public void setCacheLoaderConfig(CacheLoaderConfig config)
|
298 |
| { |
299 |
2357
| testImmutability("cacheLoaderConfig");
|
300 |
2357
| replaceChildConfig(this.cacheLoaderConfig, config);
|
301 |
2357
| this.cacheLoaderConfig = config;
|
302 |
| } |
303 |
| |
304 |
311
| public void setSyncCommitPhase(boolean syncCommitPhase)
|
305 |
| { |
306 |
311
| testImmutability("syncCommitPhase");
|
307 |
311
| this.syncCommitPhase = syncCommitPhase;
|
308 |
| } |
309 |
| |
310 |
135
| public void setSyncRollbackPhase(boolean syncRollbackPhase)
|
311 |
| { |
312 |
135
| testImmutability("syncRollbackPhase");
|
313 |
135
| this.syncRollbackPhase = syncRollbackPhase;
|
314 |
| } |
315 |
| |
316 |
170
| public void setBuddyReplicationConfig(BuddyReplicationConfig config)
|
317 |
| { |
318 |
170
| testImmutability("buddyReplicationConfig");
|
319 |
170
| replaceChildConfig(this.buddyReplicationConfig, config);
|
320 |
170
| this.buddyReplicationConfig = config;
|
321 |
| } |
322 |
| |
323 |
180
| public void setNodeLockingScheme(NodeLockingScheme nodeLockingScheme)
|
324 |
| { |
325 |
180
| testImmutability("nodeLockingScheme");
|
326 |
180
| testImmutability("nodeLockingOptimistic");
|
327 |
180
| this.nodeLockingScheme = nodeLockingScheme;
|
328 |
180
| this.nodeLockingOptimistic = (nodeLockingScheme == NodeLockingScheme.OPTIMISTIC);
|
329 |
| } |
330 |
| |
331 |
669
| public void setUseReplQueue(boolean useReplQueue)
|
332 |
| { |
333 |
669
| testImmutability("useReplQueue");
|
334 |
669
| this.useReplQueue = useReplQueue;
|
335 |
| } |
336 |
| |
337 |
494
| public void setIsolationLevel(IsolationLevel isolationLevel)
|
338 |
| { |
339 |
494
| testImmutability("isolationLevel");
|
340 |
494
| this.isolationLevel = isolationLevel;
|
341 |
| } |
342 |
| |
343 |
4
| public void setNodeLockingOptimistic(boolean nodeLockingOptimistic)
|
344 |
| { |
345 |
4
| testImmutability("nodeLockingOptimistic");
|
346 |
4
| this.nodeLockingOptimistic = nodeLockingOptimistic;
|
347 |
| } |
348 |
| |
349 |
0
| @Deprecated
|
350 |
| public void setInitialStateRetrievalTimeout(long stateRetrievalTimeout) |
351 |
| { |
352 |
0
| log.info("Do not use InitialStateRetrievalTimeout - this is deprecated and may disappear in future releases. Use StateRetrievalTimeout instead.");
|
353 |
0
| setStateRetrievalTimeout(stateRetrievalTimeout);
|
354 |
| } |
355 |
| |
356 |
1393
| public void setStateRetrievalTimeout(long stateRetrievalTimeout)
|
357 |
| { |
358 |
1393
| testImmutability("stateRetrievalTimeout");
|
359 |
1393
| this.stateRetrievalTimeout = stateRetrievalTimeout;
|
360 |
| } |
361 |
| |
362 |
328
| public void setNodeLockingScheme(String nodeLockingScheme)
|
363 |
| { |
364 |
328
| testImmutability("nodeLockingScheme");
|
365 |
328
| testImmutability("nodeLockingOptimistic");
|
366 |
328
| if (nodeLockingScheme == null)
|
367 |
| { |
368 |
0
| throw new ConfigurationException("Node locking scheme cannot be null", "NodeLockingScheme");
|
369 |
| } |
370 |
328
| this.nodeLockingScheme = NodeLockingScheme.valueOf(uc(nodeLockingScheme));
|
371 |
328
| if (this.nodeLockingScheme == null)
|
372 |
| { |
373 |
0
| log.warn("Unknown node locking scheme '" + nodeLockingScheme + "', using defaults.");
|
374 |
0
| this.nodeLockingScheme = NodeLockingScheme.PESSIMISTIC;
|
375 |
| } |
376 |
| |
377 |
328
| this.nodeLockingOptimistic = (this.nodeLockingScheme == NodeLockingScheme.OPTIMISTIC);
|
378 |
| } |
379 |
| |
380 |
2
| public String getNodeLockingSchemeString()
|
381 |
| { |
382 |
2
| return nodeLockingScheme == null ? null : nodeLockingScheme.toString();
|
383 |
| } |
384 |
| |
385 |
2
| public void setNodeLockingSchemeString(String nodeLockingScheme)
|
386 |
| { |
387 |
2
| setNodeLockingScheme(nodeLockingScheme);
|
388 |
| } |
389 |
| |
390 |
2773
| private static String uc(String s)
|
391 |
| { |
392 |
2773
| return s.toUpperCase(Locale.ENGLISH);
|
393 |
| } |
394 |
| |
395 |
1032
| public void setIsolationLevel(String isolationLevel)
|
396 |
| { |
397 |
1032
| testImmutability("isolationLevel");
|
398 |
0
| if (isolationLevel == null) throw new ConfigurationException("Isolation level cannot be null", "IsolationLevel");
|
399 |
1032
| this.isolationLevel = IsolationLevel.valueOf(uc(isolationLevel));
|
400 |
1032
| if (this.isolationLevel == null)
|
401 |
| { |
402 |
0
| log.warn("Unknown isolation level '" + isolationLevel + "', using defaults.");
|
403 |
0
| this.isolationLevel = IsolationLevel.REPEATABLE_READ;
|
404 |
| } |
405 |
| } |
406 |
| |
407 |
2
| public String getIsolationLevelString()
|
408 |
| { |
409 |
2
| return isolationLevel == null ? null : isolationLevel.toString();
|
410 |
| } |
411 |
| |
412 |
2
| public void setIsolationLevelString(String isolationLevel)
|
413 |
| { |
414 |
2
| setIsolationLevel(isolationLevel);
|
415 |
| } |
416 |
| |
417 |
| |
418 |
| |
419 |
| |
420 |
| |
421 |
| |
422 |
| |
423 |
76
| public void setLockParentForChildInsertRemove(boolean lockParentForChildInsertRemove)
|
424 |
| { |
425 |
76
| testImmutability("lockParentForChildInsertRemove");
|
426 |
76
| this.lockParentForChildInsertRemove = lockParentForChildInsertRemove;
|
427 |
| } |
428 |
| |
429 |
73
| public void setMultiplexerStack(String stackName)
|
430 |
| { |
431 |
73
| testImmutability("muxStackName");
|
432 |
73
| this.muxStackName = stackName;
|
433 |
| } |
434 |
| |
435 |
191
| public boolean isUsingMultiplexer()
|
436 |
| { |
437 |
191
| return usingMultiplexer;
|
438 |
| } |
439 |
| |
440 |
65
| public void setUsingMultiplexer(boolean usingMultiplexer)
|
441 |
| { |
442 |
65
| testImmutability("usingMultiplexer");
|
443 |
65
| this.usingMultiplexer = usingMultiplexer;
|
444 |
| } |
445 |
| |
446 |
| |
447 |
| |
448 |
| |
449 |
| |
450 |
| |
451 |
5238313
| public boolean isNodeLockingOptimistic()
|
452 |
| { |
453 |
5238313
| return nodeLockingOptimistic;
|
454 |
| } |
455 |
| |
456 |
3001
| public boolean isUseReplQueue()
|
457 |
| { |
458 |
3001
| return useReplQueue;
|
459 |
| } |
460 |
| |
461 |
4201
| public String getClusterName()
|
462 |
| { |
463 |
4201
| return clusterName;
|
464 |
| } |
465 |
| |
466 |
2127
| public String getClusterConfig()
|
467 |
| { |
468 |
2127
| return clusterConfig;
|
469 |
| } |
470 |
| |
471 |
5
| public int getReplQueueMaxElements()
|
472 |
| { |
473 |
5
| return replQueueMaxElements;
|
474 |
| } |
475 |
| |
476 |
5
| public long getReplQueueInterval()
|
477 |
| { |
478 |
5
| return replQueueInterval;
|
479 |
| } |
480 |
| |
481 |
198348
| public boolean getExposeManagementStatistics()
|
482 |
| { |
483 |
198348
| return exposeManagementStatistics;
|
484 |
| } |
485 |
| |
486 |
1870
| public boolean isFetchInMemoryState()
|
487 |
| { |
488 |
1870
| return fetchInMemoryState;
|
489 |
| } |
490 |
| |
491 |
730
| public short getReplicationVersion()
|
492 |
| { |
493 |
730
| return replicationVersion;
|
494 |
| } |
495 |
| |
496 |
1474
| public String getReplVersionString()
|
497 |
| { |
498 |
1474
| return Version.getVersionString(replicationVersion);
|
499 |
| } |
500 |
| |
501 |
5705
| public long getLockAcquisitionTimeout()
|
502 |
| { |
503 |
5705
| return lockAcquisitionTimeout;
|
504 |
| } |
505 |
| |
506 |
113543
| public long getSyncReplTimeout()
|
507 |
| { |
508 |
113543
| return syncReplTimeout;
|
509 |
| } |
510 |
| |
511 |
246887
| public CacheMode getCacheMode()
|
512 |
| { |
513 |
246887
| return cacheMode;
|
514 |
| } |
515 |
| |
516 |
5413
| public boolean isInactiveOnStartup()
|
517 |
| { |
518 |
5413
| return inactiveOnStartup;
|
519 |
| } |
520 |
| |
521 |
1610565
| public IsolationLevel getIsolationLevel()
|
522 |
| { |
523 |
1610565
| return isolationLevel;
|
524 |
| } |
525 |
| |
526 |
| |
527 |
| |
528 |
| |
529 |
| |
530 |
| |
531 |
| |
532 |
8486021
| public boolean isLockParentForChildInsertRemove()
|
533 |
| { |
534 |
8486061
| return lockParentForChildInsertRemove;
|
535 |
| } |
536 |
| |
537 |
2807
| public boolean isUseRegionBasedMarshalling()
|
538 |
| { |
539 |
2807
| return useRegionBasedMarshalling;
|
540 |
| } |
541 |
| |
542 |
5289
| public String getTransactionManagerLookupClass()
|
543 |
| { |
544 |
5289
| return transactionManagerLookupClass;
|
545 |
| } |
546 |
| |
547 |
3882
| public CacheLoaderConfig getCacheLoaderConfig()
|
548 |
| { |
549 |
3882
| return cacheLoaderConfig;
|
550 |
| } |
551 |
| |
552 |
10744
| public boolean isSyncCommitPhase()
|
553 |
| { |
554 |
10744
| return syncCommitPhase;
|
555 |
| } |
556 |
| |
557 |
34
| public boolean isSyncRollbackPhase()
|
558 |
| { |
559 |
34
| return syncRollbackPhase;
|
560 |
| } |
561 |
| |
562 |
1108
| public BuddyReplicationConfig getBuddyReplicationConfig()
|
563 |
| { |
564 |
1108
| return buddyReplicationConfig;
|
565 |
| } |
566 |
| |
567 |
262
| public NodeLockingScheme getNodeLockingScheme()
|
568 |
| { |
569 |
262
| return nodeLockingScheme;
|
570 |
| } |
571 |
| |
572 |
0
| @Deprecated
|
573 |
| public long getInitialStateRetrievalTimeout() |
574 |
| { |
575 |
0
| return getStateRetrievalTimeout();
|
576 |
| } |
577 |
| |
578 |
2265
| public long getStateRetrievalTimeout()
|
579 |
| { |
580 |
2265
| return stateRetrievalTimeout;
|
581 |
| } |
582 |
| |
583 |
1097
| public String getMultiplexerStack()
|
584 |
| { |
585 |
1097
| return muxStackName;
|
586 |
| } |
587 |
| |
588 |
432424
| public synchronized RuntimeConfig getRuntimeConfig()
|
589 |
| { |
590 |
432425
| if (runtimeConfig == null)
|
591 |
| { |
592 |
2786
| setRuntimeConfig(new RuntimeConfig(), false);
|
593 |
| } |
594 |
432425
| return runtimeConfig;
|
595 |
| } |
596 |
| |
597 |
24
| public void setRuntimeConfig(RuntimeConfig runtimeConfig)
|
598 |
| { |
599 |
24
| setRuntimeConfig(runtimeConfig, true);
|
600 |
| } |
601 |
| |
602 |
2810
| private void setRuntimeConfig(RuntimeConfig runtimeConfig, boolean testImmutability)
|
603 |
| { |
604 |
2810
| if (testImmutability)
|
605 |
| { |
606 |
24
| testImmutability("runtimeConfig");
|
607 |
| } |
608 |
2810
| this.runtimeConfig = runtimeConfig;
|
609 |
| } |
610 |
| |
611 |
2944
| public String getMarshallerClass()
|
612 |
| { |
613 |
2944
| return marshallerClass;
|
614 |
| } |
615 |
| |
616 |
0
| public void setMarshallerClass(String marshallerClass)
|
617 |
| { |
618 |
0
| this.marshallerClass = marshallerClass;
|
619 |
| } |
620 |
| |
621 |
0
| public int getNumberOfNotifierThreads()
|
622 |
| { |
623 |
0
| return numberOfNotifierThreads;
|
624 |
| } |
625 |
| |
626 |
0
| public void setNumberOfNotifierThreads(int numberOfNotifierThreads)
|
627 |
| { |
628 |
0
| this.numberOfNotifierThreads = numberOfNotifierThreads;
|
629 |
| } |
630 |
| |
631 |
| |
632 |
| |
633 |
| |
634 |
| |
635 |
| |
636 |
| |
637 |
| |
638 |
| |
639 |
| |
640 |
1
| public boolean equals(Object o)
|
641 |
| { |
642 |
1
| if (this == o) return true;
|
643 |
0
| if (o == null || getClass() != o.getClass()) return false;
|
644 |
| |
645 |
0
| final Configuration that = (Configuration) o;
|
646 |
| |
647 |
0
| if (fetchInMemoryState != that.fetchInMemoryState) return false;
|
648 |
0
| if (inactiveOnStartup != that.inactiveOnStartup) return false;
|
649 |
0
| if (stateRetrievalTimeout != that.stateRetrievalTimeout) return false;
|
650 |
0
| if (lockAcquisitionTimeout != that.lockAcquisitionTimeout) return false;
|
651 |
0
| if (nodeLockingOptimistic != that.nodeLockingOptimistic) return false;
|
652 |
0
| if (replQueueInterval != that.replQueueInterval) return false;
|
653 |
0
| if (replQueueMaxElements != that.replQueueMaxElements) return false;
|
654 |
0
| if (replicationVersion != that.replicationVersion) return false;
|
655 |
0
| if (syncCommitPhase != that.syncCommitPhase) return false;
|
656 |
0
| if (syncReplTimeout != that.syncReplTimeout) return false;
|
657 |
0
| if (syncRollbackPhase != that.syncRollbackPhase) return false;
|
658 |
0
| if (exposeManagementStatistics != that.exposeManagementStatistics) return false;
|
659 |
0
| if (useRegionBasedMarshalling != that.useRegionBasedMarshalling) return false;
|
660 |
0
| if (useReplQueue != that.useReplQueue) return false;
|
661 |
0
| if (buddyReplicationConfig != null ? !buddyReplicationConfig.equals(that.buddyReplicationConfig) : that.buddyReplicationConfig != null)
|
662 |
| { |
663 |
0
| return false;
|
664 |
| } |
665 |
0
| if (cacheLoaderConfig != null ? !cacheLoaderConfig.equals(that.cacheLoaderConfig) : that.cacheLoaderConfig != null)
|
666 |
| { |
667 |
0
| return false;
|
668 |
| } |
669 |
0
| if (cacheMode != that.cacheMode) return false;
|
670 |
0
| if (clusterConfig != null ? !clusterConfig.equals(that.clusterConfig) : that.clusterConfig != null) return false;
|
671 |
0
| if (clusterName != null ? !clusterName.equals(that.clusterName) : that.clusterName != null) return false;
|
672 |
0
| if (evictionConfig != null ? !evictionConfig.equals(that.evictionConfig) : that.evictionConfig != null)
|
673 |
| { |
674 |
0
| return false;
|
675 |
| } |
676 |
0
| if (isolationLevel != that.isolationLevel) return false;
|
677 |
0
| if (muxStackName != null ? !muxStackName.equals(that.muxStackName) : that.muxStackName != null) return false;
|
678 |
0
| if (nodeLockingScheme != that.nodeLockingScheme) return false;
|
679 |
0
| if (transactionManagerLookupClass != null ? !transactionManagerLookupClass.equals(that.transactionManagerLookupClass) : that.transactionManagerLookupClass != null)
|
680 |
| { |
681 |
0
| return false;
|
682 |
| } |
683 |
0
| if (!safeEquals(runtimeConfig, that.runtimeConfig))
|
684 |
| { |
685 |
0
| return false;
|
686 |
| } |
687 |
| |
688 |
0
| if (!safeEquals(marshallerClass, that.marshallerClass)) return false;
|
689 |
| |
690 |
0
| if (lockParentForChildInsertRemove != that.lockParentForChildInsertRemove) return false;
|
691 |
| |
692 |
0
| if (numberOfNotifierThreads != that.numberOfNotifierThreads) return false;
|
693 |
| |
694 |
0
| return true;
|
695 |
| } |
696 |
| |
697 |
8
| public int hashCode()
|
698 |
| { |
699 |
8
| int result = 17;
|
700 |
8
| result = 29 * result + (clusterName != null ? clusterName.hashCode() : 0);
|
701 |
8
| result = 29 * result + (clusterConfig != null ? clusterConfig.hashCode() : 0);
|
702 |
8
| result = 29 * result + (useReplQueue ? 1 : 0);
|
703 |
8
| result = 29 * result + replQueueMaxElements;
|
704 |
8
| result = 29 * result + (int) (replQueueInterval ^ (replQueueInterval >>> 32));
|
705 |
8
| result = 29 * result + (exposeManagementStatistics ? 1 : 0);
|
706 |
8
| result = 29 * result + (fetchInMemoryState ? 1 : 0);
|
707 |
8
| result = 29 * result + (int) replicationVersion;
|
708 |
8
| result = 29 * result + (int) (lockAcquisitionTimeout ^ (lockAcquisitionTimeout >>> 32));
|
709 |
8
| result = 29 * result + (int) (syncReplTimeout ^ (syncReplTimeout >>> 32));
|
710 |
8
| result = 29 * result + (cacheMode != null ? cacheMode.hashCode() : 0);
|
711 |
8
| result = 29 * result + (inactiveOnStartup ? 1 : 0);
|
712 |
8
| result = 29 * result + (int) (stateRetrievalTimeout ^ (stateRetrievalTimeout >>> 32));
|
713 |
8
| result = 29 * result + (isolationLevel != null ? isolationLevel.hashCode() : 0);
|
714 |
8
| result = 29 * result + (evictionConfig != null ? evictionConfig.hashCode() : 0);
|
715 |
8
| result = 29 * result + (useRegionBasedMarshalling ? 1 : 0);
|
716 |
8
| result = 29 * result + (transactionManagerLookupClass != null ? transactionManagerLookupClass.hashCode() : 0);
|
717 |
8
| result = 29 * result + (cacheLoaderConfig != null ? cacheLoaderConfig.hashCode() : 0);
|
718 |
8
| result = 29 * result + (syncCommitPhase ? 1 : 0);
|
719 |
8
| result = 29 * result + (syncRollbackPhase ? 1 : 0);
|
720 |
8
| result = 29 * result + (buddyReplicationConfig != null ? buddyReplicationConfig.hashCode() : 0);
|
721 |
8
| result = 29 * result + (nodeLockingOptimistic ? 1 : 0);
|
722 |
8
| result = 29 * result + (nodeLockingScheme != null ? nodeLockingScheme.hashCode() : 0);
|
723 |
8
| result = 29 * result + (muxStackName != null ? muxStackName.hashCode() : 0);
|
724 |
8
| result = 29 * result + (runtimeConfig != null ? runtimeConfig.hashCode() : 0);
|
725 |
8
| result = 29 * result + (marshallerClass != null ? marshallerClass.hashCode() : 0);
|
726 |
8
| result = 29 * result + (lockParentForChildInsertRemove ? 1 : 0);
|
727 |
8
| result = 29 * result + numberOfNotifierThreads;
|
728 |
8
| return result;
|
729 |
| } |
730 |
| |
731 |
24
| public Configuration clone() throws CloneNotSupportedException
|
732 |
| { |
733 |
24
| Configuration c = (Configuration) super.clone();
|
734 |
24
| if (buddyReplicationConfig != null)
|
735 |
| { |
736 |
0
| c.setBuddyReplicationConfig((BuddyReplicationConfig) buddyReplicationConfig.clone());
|
737 |
| } |
738 |
24
| if (evictionConfig != null)
|
739 |
| { |
740 |
0
| c.setEvictionConfig((EvictionConfig) evictionConfig.clone());
|
741 |
| } |
742 |
24
| if (cacheLoaderConfig != null)
|
743 |
| { |
744 |
0
| c.setCacheLoaderConfig((CacheLoaderConfig) cacheLoaderConfig.clone());
|
745 |
| } |
746 |
24
| if (runtimeConfig != null)
|
747 |
| { |
748 |
24
| c.setRuntimeConfig((RuntimeConfig) runtimeConfig.clone());
|
749 |
| |
750 |
24
| c.getRuntimeConfig().reset();
|
751 |
| } |
752 |
24
| return c;
|
753 |
| } |
754 |
| |
755 |
| } |