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.statetransfer; |
24 |
| |
25 |
| import org.jboss.cache.CacheException; |
26 |
| import org.jboss.cache.CacheSPI; |
27 |
| import org.jboss.cache.Fqn; |
28 |
| import org.jboss.cache.Version; |
29 |
| import org.jboss.cache.misc.TestingUtil; |
30 |
| import org.jboss.cache.notifications.annotation.CacheListener; |
31 |
| import org.jboss.cache.notifications.annotation.NodeModified; |
32 |
| import org.jboss.cache.notifications.event.NodeEvent; |
33 |
| |
34 |
| import javax.transaction.Synchronization; |
35 |
| import javax.transaction.Transaction; |
36 |
| import javax.transaction.TransactionManager; |
37 |
| |
38 |
| |
39 |
| |
40 |
| |
41 |
| |
42 |
| |
43 |
| |
44 |
| |
45 |
| |
46 |
| |
47 |
| public class ForcedStateTransferTest extends StateTransferTestBase |
48 |
| { |
49 |
| |
50 |
| |
51 |
| |
52 |
| |
53 |
| static class CacheStarter extends Thread |
54 |
| { |
55 |
| CacheSPI cache; |
56 |
| boolean useMarshalling; |
57 |
| Exception failure; |
58 |
| |
59 |
4
| CacheStarter(CacheSPI cache, boolean useMarshalling)
|
60 |
| { |
61 |
4
| this.cache = cache;
|
62 |
4
| this.useMarshalling = useMarshalling;
|
63 |
| } |
64 |
| |
65 |
4
| public void run()
|
66 |
| { |
67 |
4
| try
|
68 |
| { |
69 |
4
| cache.start();
|
70 |
| |
71 |
0
| if (useMarshalling)
|
72 |
| { |
73 |
| |
74 |
| |
75 |
| |
76 |
0
| TestingUtil.blockUntilViewReceived(cache, 2, 60000);
|
77 |
0
| cache.getRegion(Fqn.ROOT, true).activate();
|
78 |
| } |
79 |
| } |
80 |
| catch (Exception e) |
81 |
| { |
82 |
4
| failure = e;
|
83 |
| } |
84 |
| } |
85 |
| } |
86 |
| |
87 |
| |
88 |
| |
89 |
| |
90 |
| |
91 |
| static abstract class TaskRunner extends Thread |
92 |
| { |
93 |
| CacheSPI cache; |
94 |
| Fqn fqn; |
95 |
| String value; |
96 |
| Exception failure; |
97 |
| boolean asleep = false; |
98 |
| |
99 |
42
| TaskRunner(CacheSPI cache, String rootFqn, String value)
|
100 |
| { |
101 |
42
| this.cache = cache;
|
102 |
42
| this.value = value;
|
103 |
42
| this.fqn = new Fqn(Fqn.fromString(rootFqn), value);
|
104 |
| } |
105 |
| |
106 |
39
| public void run()
|
107 |
| { |
108 |
39
| try
|
109 |
| { |
110 |
| |
111 |
39
| executeTask();
|
112 |
| } |
113 |
| catch (Exception e) |
114 |
| { |
115 |
1
| if (!isDone())
|
116 |
1
| failure = e;
|
117 |
| } |
118 |
| finally |
119 |
| { |
120 |
10
| asleep = false;
|
121 |
| |
122 |
10
| finalCleanup();
|
123 |
| } |
124 |
| } |
125 |
| |
126 |
| abstract void executeTask() throws Exception; |
127 |
| |
128 |
| abstract boolean isDone(); |
129 |
| |
130 |
4
| void finalCleanup()
|
131 |
| { |
132 |
| } |
133 |
| |
134 |
1284357
| boolean isAsleep()
|
135 |
| { |
136 |
1284357
| return asleep;
|
137 |
| } |
138 |
| } |
139 |
| |
140 |
| |
141 |
| |
142 |
| |
143 |
| static class TxRunner extends TaskRunner |
144 |
| { |
145 |
| Transaction tx = null; |
146 |
| boolean rollback = false; |
147 |
| boolean done = true; |
148 |
| |
149 |
18
| TxRunner(CacheSPI cache, String rootFqn, String value, boolean rollback)
|
150 |
| { |
151 |
18
| super(cache, rootFqn, value);
|
152 |
18
| this.rollback = rollback;
|
153 |
| } |
154 |
| |
155 |
18
| void executeTask() throws Exception
|
156 |
| { |
157 |
18
| TransactionManager tm = cache.getTransactionManager();
|
158 |
18
| tm.begin();
|
159 |
18
| tx = tm.getTransaction();
|
160 |
| |
161 |
18
| cache.put(fqn, "KEY", value);
|
162 |
| |
163 |
18
| if (rollback)
|
164 |
9
| tx.setRollbackOnly();
|
165 |
| |
166 |
18
| asleep = true;
|
167 |
18
| TestingUtil.sleepThread((long) 25000);
|
168 |
6
| done = true;
|
169 |
| } |
170 |
| |
171 |
6
| void finalCleanup()
|
172 |
| { |
173 |
6
| if (tx != null)
|
174 |
| { |
175 |
6
| try
|
176 |
| { |
177 |
6
| tx.commit();
|
178 |
| } |
179 |
| catch (Exception ignore) |
180 |
| { |
181 |
| } |
182 |
| } |
183 |
| } |
184 |
| |
185 |
0
| boolean isDone()
|
186 |
| { |
187 |
0
| return done;
|
188 |
| } |
189 |
| } |
190 |
| |
191 |
| |
192 |
| |
193 |
| |
194 |
| @CacheListener |
195 |
| static class HangThreadListener |
196 |
| { |
197 |
| boolean asleep; |
198 |
| Fqn toHang; |
199 |
| boolean alreadyHung; |
200 |
| boolean done; |
201 |
| |
202 |
3
| HangThreadListener(Fqn toHang)
|
203 |
| { |
204 |
3
| this.toHang = toHang;
|
205 |
| } |
206 |
| |
207 |
0
| @NodeModified
|
208 |
| public void nodeModified(NodeEvent e) |
209 |
| { |
210 |
0
| if (!e.isPre()) hangThread(e.getFqn());
|
211 |
| } |
212 |
| |
213 |
0
| private void hangThread(Fqn fqn)
|
214 |
| { |
215 |
0
| if (!alreadyHung && toHang.equals(fqn))
|
216 |
| { |
217 |
0
| asleep = true;
|
218 |
| |
219 |
0
| alreadyHung = true;
|
220 |
0
| TestingUtil.sleepThread((long) 30000);
|
221 |
0
| done = true;
|
222 |
0
| asleep = false;
|
223 |
| } |
224 |
| } |
225 |
| } |
226 |
| |
227 |
| |
228 |
| |
229 |
| |
230 |
| static class HangThreadRunner extends TaskRunner |
231 |
| { |
232 |
| HangThreadListener listener; |
233 |
| |
234 |
3
| HangThreadRunner(CacheSPI cache, String rootFqn, String value)
|
235 |
| { |
236 |
3
| super(cache, rootFqn, value);
|
237 |
3
| listener = new HangThreadListener(fqn);
|
238 |
3
| cache.addCacheListener(listener);
|
239 |
| } |
240 |
| |
241 |
0
| void executeTask() throws Exception
|
242 |
| { |
243 |
| |
244 |
0
| cache.put(fqn, "KEY", value);
|
245 |
| } |
246 |
| |
247 |
0
| boolean isAsleep()
|
248 |
| { |
249 |
0
| return listener.asleep;
|
250 |
| } |
251 |
| |
252 |
0
| boolean isDone()
|
253 |
| { |
254 |
0
| return listener.done;
|
255 |
| } |
256 |
| } |
257 |
| |
258 |
| |
259 |
| |
260 |
| |
261 |
| |
262 |
| static class HangThreadSynchronization implements Synchronization |
263 |
| { |
264 |
| boolean asleep; |
265 |
| boolean hangBefore; |
266 |
| boolean done; |
267 |
| |
268 |
21
| HangThreadSynchronization(boolean hangBefore)
|
269 |
| { |
270 |
21
| this.hangBefore = hangBefore;
|
271 |
| } |
272 |
| |
273 |
20
| public void beforeCompletion()
|
274 |
| { |
275 |
20
| if (hangBefore)
|
276 |
| { |
277 |
9
| hang();
|
278 |
| } |
279 |
| } |
280 |
| |
281 |
14
| public void afterCompletion(int status)
|
282 |
| { |
283 |
14
| if (!hangBefore)
|
284 |
| { |
285 |
11
| hang();
|
286 |
| } |
287 |
| } |
288 |
| |
289 |
20
| void hang()
|
290 |
| { |
291 |
20
| asleep = true;
|
292 |
20
| TestingUtil.sleepThread((long) 30000);
|
293 |
3
| done = true;
|
294 |
| } |
295 |
| |
296 |
| } |
297 |
| |
298 |
| |
299 |
| |
300 |
| |
301 |
| |
302 |
| static class SynchronizationTxRunner extends TaskRunner |
303 |
| { |
304 |
| Transaction tx = null; |
305 |
| HangThreadSynchronization sync; |
306 |
| |
307 |
21
| SynchronizationTxRunner(CacheSPI cache, String rootFqn, String value, boolean hangBefore)
|
308 |
| { |
309 |
21
| super(cache, rootFqn, value);
|
310 |
21
| this.sync = new HangThreadSynchronization(hangBefore);
|
311 |
| } |
312 |
| |
313 |
21
| void executeTask() throws Exception
|
314 |
| { |
315 |
21
| TransactionManager tm = cache.getTransactionManager();
|
316 |
21
| tm.begin();
|
317 |
21
| tx = tm.getTransaction();
|
318 |
21
| tx.registerSynchronization(sync);
|
319 |
| |
320 |
21
| cache.put(fqn, "KEY", value);
|
321 |
| |
322 |
| |
323 |
20
| tx.commit();
|
324 |
| } |
325 |
| |
326 |
1142997
| boolean isAsleep()
|
327 |
| { |
328 |
1142997
| return sync.asleep;
|
329 |
| } |
330 |
| |
331 |
1
| boolean isDone()
|
332 |
| { |
333 |
1
| return sync.done;
|
334 |
| } |
335 |
| } |
336 |
| |
337 |
| |
338 |
| |
339 |
| |
340 |
| |
341 |
| |
342 |
| |
343 |
1
| public void testActiveTransaction() throws Exception
|
344 |
| { |
345 |
1
| String[] values = {"A", "B", "C"};
|
346 |
1
| transactionTest(values, false, "REPEATABLE_READ");
|
347 |
| } |
348 |
| |
349 |
| |
350 |
| |
351 |
| |
352 |
| |
353 |
| |
354 |
| |
355 |
1
| public void testRollbackOnlyTransaction() throws Exception
|
356 |
| { |
357 |
1
| String[] values = {"A", "B", "C"};
|
358 |
1
| transactionTest(values, true, "REPEATABLE_READ");
|
359 |
| } |
360 |
| |
361 |
| |
362 |
| |
363 |
| |
364 |
| |
365 |
| |
366 |
| |
367 |
| |
368 |
| |
369 |
| |
370 |
| |
371 |
2
| private void transactionTest(String[] values,
|
372 |
| boolean rollback, |
373 |
| String isolationLevel) throws Exception |
374 |
| { |
375 |
| |
376 |
2
| CacheSPI sender = initializeSender(isolationLevel, false, false);
|
377 |
| |
378 |
| |
379 |
2
| TxRunner[] runners =
|
380 |
| initializeTransactionRunners(values, sender, "/LOCK", rollback); |
381 |
| |
382 |
| |
383 |
2
| CacheSPI receiver = startReceiver(isolationLevel, false, false);
|
384 |
| |
385 |
| |
386 |
0
| checkResults(receiver, runners, false);
|
387 |
| } |
388 |
| |
389 |
| |
390 |
| |
391 |
| |
392 |
| |
393 |
| |
394 |
| |
395 |
| |
396 |
| |
397 |
| |
398 |
| |
399 |
| |
400 |
9
| private CacheSPI initializeSender(String isolationLevel,
|
401 |
| boolean replSync, |
402 |
| boolean useMarshalling) throws Exception |
403 |
| { |
404 |
9
| CacheSPI sender = createCache("sender", isolationLevel, replSync, useMarshalling, true);
|
405 |
| |
406 |
9
| if (useMarshalling)
|
407 |
1
| sender.getRegion(Fqn.ROOT, true).activate();
|
408 |
| |
409 |
9
| sender.put(Fqn.fromString("/OK"), "KEY", "X");
|
410 |
| |
411 |
9
| return sender;
|
412 |
| } |
413 |
| |
414 |
| |
415 |
| |
416 |
| |
417 |
| |
418 |
| |
419 |
| |
420 |
| |
421 |
| |
422 |
| |
423 |
| |
424 |
| |
425 |
| |
426 |
| |
427 |
6
| private TxRunner[] initializeTransactionRunners(String[] values,
|
428 |
| CacheSPI sender, |
429 |
| String rootFqn, |
430 |
| boolean rollback) |
431 |
| { |
432 |
6
| TxRunner[] runners = new TxRunner[values.length];
|
433 |
6
| for (int i = 0; i < values.length; i++)
|
434 |
| { |
435 |
18
| runners[i] = new TxRunner(sender, rootFqn, values[i], rollback);
|
436 |
18
| initializeRunner(runners[i]);
|
437 |
| } |
438 |
| |
439 |
6
| return runners;
|
440 |
| } |
441 |
| |
442 |
| |
443 |
| |
444 |
| |
445 |
| |
446 |
| |
447 |
| |
448 |
39
| private void initializeRunner(TaskRunner runner)
|
449 |
| { |
450 |
39
| runner.start();
|
451 |
| |
452 |
| |
453 |
39
| long start = System.currentTimeMillis();
|
454 |
39
| while (!(runner.isAsleep()))
|
455 |
| { |
456 |
2427317
| assertTrue(runner.getClass().getName() + " " + runner.value +
|
457 |
| " is alive", runner.isAlive()); |
458 |
| |
459 |
2427317
| assertFalse(runner.getClass().getName() + " " + runner.value +
|
460 |
| " has not timed out", |
461 |
| (System.currentTimeMillis() - start) > 1000); |
462 |
| } |
463 |
| } |
464 |
| |
465 |
| |
466 |
| |
467 |
| |
468 |
| |
469 |
| |
470 |
| |
471 |
| |
472 |
| |
473 |
| |
474 |
| |
475 |
0
| private void checkResults(CacheSPI receiver,
|
476 |
| TaskRunner[] runners, |
477 |
| boolean allowValues) throws CacheException |
478 |
| { |
479 |
| |
480 |
0
| boolean[] aliveStates = new boolean[runners.length];
|
481 |
0
| for (int i = 0; i < runners.length; i++)
|
482 |
| { |
483 |
0
| aliveStates[i] = runners[i].isAlive();
|
484 |
0
| if (aliveStates[i])
|
485 |
0
| runners[i].interrupt();
|
486 |
| } |
487 |
| |
488 |
| |
489 |
0
| assertEquals("OK value correct", "X", receiver.get(Fqn.fromString("/OK"), "KEY"));
|
490 |
| |
491 |
0
| for (int i = 0; i < runners.length; i++)
|
492 |
| { |
493 |
0
| assertTrue("Runner " + runners[i].value + " was alive", aliveStates[i]);
|
494 |
0
| assertNull("Runner " + runners[i].value + " ran cleanly", runners[i].failure);
|
495 |
0
| if (allowValues)
|
496 |
| { |
497 |
0
| assertEquals("Correct value in " + runners[i].fqn,
|
498 |
| runners[i].value, receiver.get(runners[i].fqn, "KEY")); |
499 |
| } |
500 |
| else |
501 |
| { |
502 |
0
| assertNull("No value in " + runners[i].fqn,
|
503 |
| receiver.get(runners[i].fqn, "KEY")); |
504 |
| } |
505 |
| } |
506 |
| } |
507 |
| |
508 |
| |
509 |
| |
510 |
| |
511 |
| |
512 |
| |
513 |
| |
514 |
1
| public void testHungThread() throws Exception
|
515 |
| { |
516 |
| |
517 |
1
| CacheSPI sender = initializeSender("REPEATABLE_READ", false, false);
|
518 |
| |
519 |
| |
520 |
1
| String[] values = {"A", "B", "C"};
|
521 |
1
| HangThreadRunner[] runners = initializeHangThreadRunners(values, sender, "/LOCK");
|
522 |
| |
523 |
| |
524 |
0
| CacheSPI receiver = startReceiver("REPEATABLE_READ", false, false);
|
525 |
| |
526 |
| |
527 |
0
| checkResults(receiver, runners, true);
|
528 |
| } |
529 |
| |
530 |
| |
531 |
| |
532 |
| |
533 |
| |
534 |
| |
535 |
| |
536 |
| |
537 |
| |
538 |
| |
539 |
| |
540 |
| |
541 |
| |
542 |
3
| private HangThreadRunner[] initializeHangThreadRunners(String[] values,
|
543 |
| CacheSPI sender, |
544 |
| String rootFqn) |
545 |
| { |
546 |
3
| HangThreadRunner[] runners = new HangThreadRunner[values.length];
|
547 |
3
| for (int i = 0; i < values.length; i++)
|
548 |
| { |
549 |
3
| runners[i] = new HangThreadRunner(sender, rootFqn, values[i]);
|
550 |
0
| initializeRunner(runners[i]);
|
551 |
| } |
552 |
| |
553 |
0
| return runners;
|
554 |
| } |
555 |
| |
556 |
| |
557 |
| |
558 |
| |
559 |
| |
560 |
| |
561 |
| |
562 |
| |
563 |
1
| public void testBeforeCompletionLock() throws Exception
|
564 |
| { |
565 |
1
| synchronizationTest(true);
|
566 |
| } |
567 |
| |
568 |
| |
569 |
| |
570 |
| |
571 |
| |
572 |
| |
573 |
| |
574 |
| |
575 |
1
| public void testAfterCompletionLock() throws Exception
|
576 |
| { |
577 |
1
| synchronizationTest(false);
|
578 |
| } |
579 |
| |
580 |
| |
581 |
| |
582 |
| |
583 |
| |
584 |
| |
585 |
| |
586 |
| |
587 |
| |
588 |
| |
589 |
| |
590 |
| |
591 |
2
| private void synchronizationTest(boolean hangBefore) throws Exception
|
592 |
| { |
593 |
2
| CacheSPI sender = initializeSender("REPEATABLE_READ", false, false);
|
594 |
| |
595 |
2
| String[] values = {"A", "B", "C"};
|
596 |
2
| SynchronizationTxRunner[] runners =
|
597 |
| initializeSynchronizationTxRunners(values, sender, "/LOCK", hangBefore); |
598 |
| |
599 |
2
| CacheSPI receiver = startReceiver("REPEATABLE_READ", false, false);
|
600 |
| |
601 |
0
| checkResults(receiver, runners, !hangBefore);
|
602 |
| } |
603 |
| |
604 |
| |
605 |
| |
606 |
| |
607 |
| |
608 |
| |
609 |
| |
610 |
| |
611 |
| |
612 |
| |
613 |
| |
614 |
| |
615 |
| |
616 |
| |
617 |
| |
618 |
| |
619 |
| |
620 |
8
| private SynchronizationTxRunner[] initializeSynchronizationTxRunners(String[] values,
|
621 |
| CacheSPI sender, |
622 |
| String rootFqn, |
623 |
| boolean hangBefore) |
624 |
| { |
625 |
8
| SynchronizationTxRunner[] runners =
|
626 |
| new SynchronizationTxRunner[values.length]; |
627 |
8
| for (int i = 0; i < values.length; i++)
|
628 |
| { |
629 |
21
| runners[i] = new SynchronizationTxRunner(sender, rootFqn, values[i], hangBefore);
|
630 |
21
| initializeRunner(runners[i]);
|
631 |
| } |
632 |
6
| return runners;
|
633 |
| } |
634 |
| |
635 |
| |
636 |
| |
637 |
| |
638 |
| |
639 |
| |
640 |
| |
641 |
| |
642 |
| |
643 |
1
| public void testMultipleProblems() throws Exception
|
644 |
| { |
645 |
1
| multipleProblemTest("REPEATABLE_READ", "/LOCK", false, false);
|
646 |
| } |
647 |
| |
648 |
| |
649 |
| |
650 |
| |
651 |
| |
652 |
| |
653 |
| |
654 |
| |
655 |
1
| public void testSerializableIsolation() throws Exception
|
656 |
| { |
657 |
1
| multipleProblemTest("SERIALIZABLE", "/", false, false);
|
658 |
| } |
659 |
| |
660 |
| |
661 |
| |
662 |
| |
663 |
| |
664 |
| |
665 |
| |
666 |
| |
667 |
| |
668 |
1
| public void testPartialStateTransfer() throws Exception
|
669 |
| { |
670 |
1
| multipleProblemTest("REPEATABLE_READ", "/LOCK", false, true);
|
671 |
| } |
672 |
| |
673 |
| |
674 |
| |
675 |
| |
676 |
| |
677 |
| |
678 |
| |
679 |
| |
680 |
| |
681 |
1
| public void testReplSync() throws Exception
|
682 |
| { |
683 |
1
| multipleProblemTest("REPEATABLE_READ", "/LOCK", true, false);
|
684 |
| } |
685 |
| |
686 |
| |
687 |
| |
688 |
| |
689 |
| |
690 |
| |
691 |
| |
692 |
4
| private void multipleProblemTest(String isolationLevel,
|
693 |
| String rootFqn, |
694 |
| boolean replSync, |
695 |
| boolean useMarshalling) throws Exception |
696 |
| { |
697 |
4
| CacheSPI sender = initializeSender(isolationLevel, replSync, useMarshalling);
|
698 |
| |
699 |
| |
700 |
| |
701 |
| |
702 |
| |
703 |
| |
704 |
4
| String[] val1 = {"A", "B", "C"};
|
705 |
4
| SynchronizationTxRunner[] after =
|
706 |
| initializeSynchronizationTxRunners(val1, sender, rootFqn, false); |
707 |
| |
708 |
2
| String[] val2 = {"D", "E", "F"};
|
709 |
2
| SynchronizationTxRunner[] before =
|
710 |
| initializeSynchronizationTxRunners(val2, sender, rootFqn, true); |
711 |
| |
712 |
2
| String[] val3 = {"G", "H", "I"};
|
713 |
2
| TxRunner[] active =
|
714 |
| initializeTransactionRunners(val3, sender, rootFqn, false); |
715 |
| |
716 |
2
| String[] val4 = {"J", "K", "L"};
|
717 |
2
| TxRunner[] rollback =
|
718 |
| initializeTransactionRunners(val4, sender, rootFqn, true); |
719 |
| |
720 |
2
| String[] val5 = {"M", "N", "O"};
|
721 |
2
| HangThreadRunner[] threads =
|
722 |
| initializeHangThreadRunners(val5, sender, rootFqn); |
723 |
| |
724 |
0
| CacheSPI receiver = startReceiver(isolationLevel, replSync, useMarshalling);
|
725 |
| |
726 |
0
| checkResults(receiver, active, false);
|
727 |
0
| checkResults(receiver, rollback, false);
|
728 |
0
| checkResults(receiver, before, false);
|
729 |
0
| checkResults(receiver, after, true);
|
730 |
0
| checkResults(receiver, threads, true);
|
731 |
| } |
732 |
| |
733 |
13
| protected String getReplicationVersion()
|
734 |
| { |
735 |
13
| return Version.version;
|
736 |
| } |
737 |
| |
738 |
| |
739 |
| |
740 |
| |
741 |
| |
742 |
| |
743 |
| |
744 |
| |
745 |
| |
746 |
| |
747 |
| |
748 |
4
| private CacheSPI startReceiver(String isolationLevel,
|
749 |
| boolean replSync, |
750 |
| boolean useMarshalling) throws Exception |
751 |
| { |
752 |
4
| CacheSPI receiver = createCache("receiver", isolationLevel, replSync, useMarshalling, false);
|
753 |
| |
754 |
| |
755 |
| |
756 |
4
| CacheStarter starter = new CacheStarter(receiver, useMarshalling);
|
757 |
| |
758 |
4
| starter.start();
|
759 |
| |
760 |
4
| starter.join(20000);
|
761 |
| |
762 |
4
| boolean alive = starter.isAlive();
|
763 |
4
| if (alive)
|
764 |
0
| starter.interrupt();
|
765 |
4
| assertFalse("Starter finished", alive);
|
766 |
| |
767 |
4
| assertNull("No exceptions in starter", starter.failure);
|
768 |
| |
769 |
0
| return receiver;
|
770 |
| } |
771 |
| |
772 |
| |
773 |
| |
774 |
| |
775 |
| |
776 |
13
| private CacheSPI createCache(String cacheID,
|
777 |
| String isolationLevel, |
778 |
| boolean replSync, |
779 |
| boolean useMarshalling, |
780 |
| boolean startCache) |
781 |
| throws Exception |
782 |
| { |
783 |
13
| CacheSPI result = super.createCache(cacheID, replSync,
|
784 |
| useMarshalling, false, false, false); |
785 |
13
| result.getConfiguration().setStateRetrievalTimeout(0);
|
786 |
13
| result.getConfiguration().setLockAcquisitionTimeout(1000);
|
787 |
13
| result.getConfiguration().setIsolationLevel(isolationLevel);
|
788 |
| |
789 |
13
| if (startCache)
|
790 |
9
| result.start();
|
791 |
| |
792 |
13
| return result;
|
793 |
| } |
794 |
| |
795 |
| |
796 |
| } |