01: package org.objectweb.celtix.application.test;
02:
03: public class GreeterWithConstructorDelay {
04: private static int delay;
05:
06: public GreeterWithConstructorDelay() {
07: try {
08: Thread.sleep(getDelay());
09: } catch (InterruptedException ex) {
10: // ignore
11: }
12: }
13:
14: private synchronized int getDelay() {
15: delay = (delay + 250) % 500;
16: return delay;
17: }
18: }
|