Logo Search packages:      
Sourcecode: icedtea-web version File versions  Download package

void net::sourceforge::jnlp::runtime::JNLPClassLoader::installShutdownHooks (  )  [inline, private]

Install JVM shutdown hooks to clean up resources allocated by this ClassLoader.

Definition at line 181 of file JNLPClassLoader.java.

References nativeDir.

Referenced by JNLPClassLoader().

                                        {
        Runtime.getRuntime().addShutdownHook(new Thread() {
            @Override
            public void run() {
                if (JNLPRuntime.isDebug()) {
                    System.out.println("Cleaning up native directory" + nativeDir.getAbsolutePath());
                }

                /*
                 * Delete only the native dir created by this classloader (if
                 * there is one). Other classloaders (parent, peers) will all
                 * cleanup things they created
                 */
                if (nativeDir != null) {
                    try {
                        FileUtils.recursiveDelete(nativeDir,
                                new File(System.getProperty("java.io.tmpdir")));
                    } catch (IOException e) {
                        /*
                         * failed to delete a file in tmpdir, no big deal (not
                         * to mention that the VM is shutting down at this
                         * point so no much we can do)
                         */
                    }
                }
            }
        });
    }


Generated by  Doxygen 1.6.0   Back to index