summaryrefslogtreecommitdiff
path: root/java/src/Ice/Application.java
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2003-06-30 15:27:09 +0000
committerBenoit Foucher <benoit@zeroc.com>2003-06-30 15:27:09 +0000
commit51a11f122e6277367f1dc1046730c9882ce205db (patch)
tree2bb0c30ca856657c1f3258a38ade86021e52f26b /java/src/Ice/Application.java
parentmerging changes from Evictor branch (diff)
downloadice-51a11f122e6277367f1dc1046730c9882ce205db.tar.bz2
ice-51a11f122e6277367f1dc1046730c9882ce205db.tar.xz
ice-51a11f122e6277367f1dc1046730c9882ce205db.zip
Bug fix
Diffstat (limited to 'java/src/Ice/Application.java')
-rw-r--r--java/src/Ice/Application.java51
1 files changed, 51 insertions, 0 deletions
diff --git a/java/src/Ice/Application.java b/java/src/Ice/Application.java
index a5cd647eb67..158a5a63174 100644
--- a/java/src/Ice/Application.java
+++ b/java/src/Ice/Application.java
@@ -149,6 +149,24 @@ public abstract class Application
synchronized public static void
destroyOnInterrupt()
{
+ //
+ // Remove the shutdown hook it's set.
+ //
+ if(_shutdownHook != null)
+ {
+ try
+ {
+ Runtime.getRuntime().removeShutdownHook(_shutdownHook);
+ _shutdownHook = null;
+ }
+ catch(java.lang.IllegalStateException ex)
+ {
+ //
+ // Expected if we are in the process of shutting down.
+ //
+ }
+ }
+
if(_destroyHook == null)
{
//
@@ -174,6 +192,24 @@ public abstract class Application
synchronized public static void
shutdownOnInterrupt()
{
+ //
+ // Remove the destroy hook if it's set.
+ //
+ if(_destroyHook != null)
+ {
+ try
+ {
+ Runtime.getRuntime().removeShutdownHook(_destroyHook);
+ _destroyHook = null;
+ }
+ catch(java.lang.IllegalStateException ex)
+ {
+ //
+ // Expected if we are in the process of shutting down.
+ //
+ }
+ }
+
if(_shutdownHook == null)
{
//
@@ -213,6 +249,21 @@ public abstract class Application
//
}
}
+
+ if(_destroyHook != null)
+ {
+ try
+ {
+ Runtime.getRuntime().removeShutdownHook(_destroyHook);
+ _destroyHook = null;
+ }
+ catch(java.lang.IllegalStateException ex)
+ {
+ //
+ // Expected if we are in the process of shutting down.
+ //
+ }
+ }
}
synchronized public static boolean