/** * This method is reserved for those objects (like shutdown hooks) that are aware of the VM going down - at which * time it would be appropriate to give the native libraries a chance to clean up after themselves. */ public static synchronized void shutdown() { // Unclear if this should be 'shutdownNow()' or not // This is used to execute sub processes; so it seems polite to wait for completion executor.shutdown(); // This is needed by tests executor = Executors.newCachedThreadPool(threadFactory); javaSystemInfo = new JavaSystemInfo(executor); if (initialized) { // initialized is only ever set to true if the native layer was actually initialized // we don't want or need to check enabled/disabled here; we could have disabled after // the native library was initialized // Does not look like there are any static SIGAR methods that need to be called at shutdown; // Sigar.finalize() takes care of instance cleanup // try // { // Sigar.XXXshutdownXXX(); // } // catch ( Throwable t ) // { // } initialized = false; cachedSystemInfo = null; } }
/** * This method is reserved for those objects (like shutdown hooks) that are aware of the VM going down - at which * time it would be appropriate to give the native libraries a chance to clean up after themselves. */ public static synchronized void shutdown() { // Unclear if this should be 'shutdownNow()' or not // This is used to execute sub processes; so it seems polite to wait for completion executor.shutdown(); // This is needed by tests executor = Executors.newCachedThreadPool(threadFactory); javaSystemInfo = new JavaSystemInfo(executor); if (initialized) { // initialized is only ever set to true if the native layer was actually initialized // we don't want or need to check enabled/disabled here; we could have disabled after // the native library was initialized // Does not look like there are any static SIGAR methods that need to be called at shutdown; // Sigar.finalize() takes care of instance cleanup // try // { // Sigar.XXXshutdownXXX(); // } // catch ( Throwable t ) // { // } initialized = false; cachedSystemInfo = null; } }