summaryrefslogtreecommitdiff
path: root/java/demo/Ice/value/Client.java
diff options
context:
space:
mode:
authorMatthew Newhook <matthew@zeroc.com>2006-12-22 18:52:53 +0000
committerMatthew Newhook <matthew@zeroc.com>2006-12-22 18:52:53 +0000
commit84d9f5c369fceccfa16401ed50783ed2ad209559 (patch)
tree689d30c8707629f1db8155edadb47ce1bce363ad /java/demo/Ice/value/Client.java
parentAdded autoflushing of batches (diff)
downloadice-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/value/Client.java')
-rw-r--r--java/demo/Ice/value/Client.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/java/demo/Ice/value/Client.java b/java/demo/Ice/value/Client.java
index 3ef39e8a35b..f33166da5fd 100644
--- a/java/demo/Ice/value/Client.java
+++ b/java/demo/Ice/value/Client.java
@@ -11,6 +11,22 @@ import Demo.*;
public class Client extends Ice.Application
{
+ class ShutdownHook extends Thread
+ {
+ public void
+ run()
+ {
+ try
+ {
+ communicator().destroy();
+ }
+ catch(Ice.LocalException ex)
+ {
+ ex.printStackTrace();
+ }
+ }
+ }
+
private static void
readline(java.io.BufferedReader in)
{
@@ -27,6 +43,13 @@ public class Client extends Ice.Application
public int
run(String[] args)
{
+ //
+ // Since this is an interactive demo we want to clear the
+ // Application installed interrupt callback and install our
+ // own shutdown hook.
+ //
+ setInterruptHook(new ShutdownHook());
+
Ice.ObjectPrx base = communicator().propertyToProxy("Value.Initial");
InitialPrx initial = InitialPrxHelper.checkedCast(base);
if(initial == null)