[jboss-cvs] JBossCache/src/org/jboss/cache ...
Manik Surtani
manik at jboss.org
Tue May 22 04:47:50 EDT 2007
User: msurtani
Date: 07/05/22 04:47:50
Modified: src/org/jboss/cache CacheImpl.java
Log:
Added shutdown hook
Revision Changes Path
1.65 +19 -8 JBossCache/src/org/jboss/cache/CacheImpl.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: CacheImpl.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/CacheImpl.java,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -b -r1.64 -r1.65
--- CacheImpl.java 17 May 2007 18:49:12 -0000 1.64
+++ CacheImpl.java 22 May 2007 08:47:50 -0000 1.65
@@ -757,6 +757,17 @@
notifier.notifyCacheStarted(this, true);
started = true;
log.info("JBoss Cache version: " + getVersion());
+
+ // install a VM shutdown hook
+ Thread shutdownHook = new Thread()
+ {
+ public void run()
+ {
+ CacheImpl.this.stop();
+ }
+ };
+
+ Runtime.getRuntime().addShutdownHook(shutdownHook);
}
/**
More information about the jboss-cvs-commits
mailing list