diff options
author | Matthew Newhook <matthew@zeroc.com> | 2006-12-22 18:52:53 +0000 |
---|---|---|
committer | Matthew Newhook <matthew@zeroc.com> | 2006-12-22 18:52:53 +0000 |
commit | 84d9f5c369fceccfa16401ed50783ed2ad209559 (patch) | |
tree | 689d30c8707629f1db8155edadb47ce1bce363ad /java/demo/Ice/nested/Client.java | |
parent | Added autoflushing of batches (diff) | |
download | ice-84d9f5c369fceccfa16401ed50783ed2ad209559.tar.bz2 ice-84d9f5c369fceccfa16401ed50783ed2ad209559.tar.xz ice-84d9f5c369fceccfa16401ed50783ed2ad209559.zip |
http://bugzilla.zeroc.com/bugzilla/show_bug.cgi?id=1391.
Diffstat (limited to 'java/demo/Ice/nested/Client.java')
-rw-r--r-- | java/demo/Ice/nested/Client.java | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/java/demo/Ice/nested/Client.java b/java/demo/Ice/nested/Client.java index b16a183b257..60264585c7e 100644 --- a/java/demo/Ice/nested/Client.java +++ b/java/demo/Ice/nested/Client.java @@ -11,10 +11,40 @@ import Demo.*; public class Client extends Ice.Application { + class ShutdownHook extends Thread + { + public void + run() + { + /* + * For this demo we won't destroy the communicator since it has to + * wait for any outstanding invocations to complete which may take + * some time if the nesting level is exceeded. + * + try + { + communicator().destroy(); + } + catch(Ice.LocalException ex) + { + ex.printStackTrace(); + } + */ + } + } + public int run(String[] args) { - NestedPrx nested = NestedPrxHelper.checkedCast(communicator().propertyToProxy("Nested.Client.NestedServer")); + // + // Since this is an interactive demo we want to clear the + // Application installed interrupt callback and install our + // own shutdown hook. + // + setInterruptHook(new ShutdownHook()); + + NestedPrx nested = NestedPrxHelper.checkedCast( + communicator().propertyToProxy("Nested.Client.NestedServer")); if(nested == null) { System.err.println("invalid proxy"); |