summaryrefslogtreecommitdiff
path: root/java/demo/Ice/multicast/DiscoverReplyI.java
diff options
context:
space:
mode:
authorDwayne Boone <dwayne@zeroc.com>2008-01-16 10:51:58 -0330
committerDwayne Boone <dwayne@zeroc.com>2008-01-16 10:51:58 -0330
commit56edc882ca5c9fb83001c107d1cf411a3815b9ec (patch)
treebb040a6650459b4b294026068b566cc3fb1cbc5a /java/demo/Ice/multicast/DiscoverReplyI.java
parentPartial fix for bug #2642 (diff)
downloadice-56edc882ca5c9fb83001c107d1cf411a3815b9ec.tar.bz2
ice-56edc882ca5c9fb83001c107d1cf411a3815b9ec.tar.xz
ice-56edc882ca5c9fb83001c107d1cf411a3815b9ec.zip
Added multicast discovery demo
Diffstat (limited to 'java/demo/Ice/multicast/DiscoverReplyI.java')
-rw-r--r--java/demo/Ice/multicast/DiscoverReplyI.java50
1 files changed, 50 insertions, 0 deletions
diff --git a/java/demo/Ice/multicast/DiscoverReplyI.java b/java/demo/Ice/multicast/DiscoverReplyI.java
new file mode 100644
index 00000000000..abe327dc1b9
--- /dev/null
+++ b/java/demo/Ice/multicast/DiscoverReplyI.java
@@ -0,0 +1,50 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+import Demo.*;
+
+public class DiscoverReplyI extends _DiscoverReplyDisp
+{
+ public synchronized void
+ reply(Ice.ObjectPrx obj, Ice.Current current)
+ {
+ if(_obj == null)
+ {
+ _obj = obj;
+ }
+ notify();
+ }
+
+ public synchronized Ice.ObjectPrx
+ waitReply(long timeout)
+ {
+ long end = System.currentTimeMillis() + timeout;
+ while(_obj == null)
+ {
+ long delay = end - System.currentTimeMillis();
+ if(delay > 0)
+ {
+ try
+ {
+ wait(delay);
+ }
+ catch(java.lang.InterruptedException ex)
+ {
+ }
+ }
+ else
+ {
+ break;
+ }
+ }
+ return _obj;
+ }
+
+ private Ice.ObjectPrx _obj;
+}