diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2008-01-16 10:51:58 -0330 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2008-01-16 10:51:58 -0330 |
commit | 56edc882ca5c9fb83001c107d1cf411a3815b9ec (patch) | |
tree | bb040a6650459b4b294026068b566cc3fb1cbc5a /java/demo/Ice/multicast/DiscoverReplyI.java | |
parent | Partial fix for bug #2642 (diff) | |
download | ice-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.java | 50 |
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; +} |