System.out.flush();
Thread.sleep(10 * 1000);
System.out.println("T1: setting entry");
System.out.flush();
space.add("abc", new IntegerRange("10-20,,,,,100-1000"));
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalRangeFormatException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
};
Thread t2 = new Thread("t2") {
public void run() {
Namespace space = SimpleNamespace.getDefault();
LookupResult<IntegerRange> result = space.lookup("abc", IntegerRange.class);
System.out.println("T2: waiting on 'abc' lookup");
System.out.flush();
IntegerRange s = result.waitForResult();
System.out.println("T2: s=" + s);
System.out.flush();
}
};
Thread t3 = new Thread("t3") {
public void run() {
Namespace space = SimpleNamespace.getDefault();
LookupResult<IntegerRange> result = space.lookup("abc", IntegerRange.class);
System.out.println("T3: waiting on 'abc' lookup");
System.out.flush();
IntegerRange s = result.waitForResult();
System.out.println("T3: s=" + s);
System.out.flush();
}
};