From: Sasa M. <sa...@us...> - 2004-09-27 14:32:23
|
Update of /cvsroot/jrobin/src/org/jrobin/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16873/org/jrobin/core Modified Files: RrdDbPool.java RrdNioBackend.java Log Message: Added shutdown hook to close all open RrdDb files held in the pool when the JVM is about to exit. Added method to close() the pool manualy (it's not harmful to close the file more than once). Index: RrdNioBackend.java =================================================================== RCS file: /cvsroot/jrobin/src/org/jrobin/core/RrdNioBackend.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** RrdNioBackend.java 16 Jul 2004 14:16:38 -0000 1.15 --- RrdNioBackend.java 27 Sep 2004 14:32:13 -0000 1.16 *************** *** 52,60 **** */ public static final boolean SHOULD_GC = true; static { if(SHOULD_GC) { final Runtime runtime = Runtime.getRuntime(); ! runtime.addShutdownHook(new Thread() { public void run() { runtime.runFinalization(); --- 52,61 ---- */ public static final boolean SHOULD_GC = true; + private static final String NIO_CLOSING_THREAD_NAME = "RrdNioBackend closing thread"; static { if(SHOULD_GC) { final Runtime runtime = Runtime.getRuntime(); ! runtime.addShutdownHook(new Thread(NIO_CLOSING_THREAD_NAME) { public void run() { runtime.runFinalization(); |