summaryrefslogtreecommitdiff
path: root/java/demo/Freeze/library/Collocated.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/demo/Freeze/library/Collocated.java')
-rw-r--r--java/demo/Freeze/library/Collocated.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/java/demo/Freeze/library/Collocated.java b/java/demo/Freeze/library/Collocated.java
index ec6beade155..8cb11e19a00 100644
--- a/java/demo/Freeze/library/Collocated.java
+++ b/java/demo/Freeze/library/Collocated.java
@@ -9,9 +9,32 @@
class LibraryCollocated extends Ice.Application
{
+ class ShutdownHook extends Thread
+ {
+ public void
+ run()
+ {
+ try
+ {
+ communicator().destroy();
+ }
+ catch(Ice.LocalException ex)
+ {
+ ex.printStackTrace();
+ }
+ }
+ }
+
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.Properties properties = communicator().getProperties();
//