diff options
Diffstat (limited to 'java/demo/IceGrid/simple/Client.java')
-rw-r--r-- | java/demo/IceGrid/simple/Client.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/java/demo/IceGrid/simple/Client.java b/java/demo/IceGrid/simple/Client.java index 1c9333080ba..d5ae5065837 100644 --- a/java/demo/IceGrid/simple/Client.java +++ b/java/demo/IceGrid/simple/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 void menu() { @@ -26,6 +42,13 @@ public class Client extends Ice.Application 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()); + + // // First we try to connect to the object with the `hello' // identity. If it's not registered with the registry, we // search for an object with the ::Demo::Hello type. |