import compbio.engine.local.ExecutableWrapper;\r
import compbio.engine.local.LocalExecutorService;\r
import compbio.util.PropertyHelper;\r
-import compbio.util.Util;\r
\r
/**\r
* Two tasks:\r
@Override\r
public void contextDestroyed(ServletContextEvent ignored) {\r
// stop cleaning job directories\r
-// try {\r
+ try {\r
if (null != localcl) {\r
localcl.cancel(true);\r
}\r
if (null != clustercl) {\r
clustercl.cancel(true);\r
}\r
- //executor.shutdown();\r
- //executor.awaitTermination(3, TimeUnit.SECONDS);\r
-// } catch (InterruptedException e) {\r
-// log.warn(e.getMessage(), e);\r
-// }\r
- // Shutdown local engine\r
- log.info("JABAWS context is destroyed. Shutting down engines...");\r
- LocalExecutorService.shutDown();\r
- log.info("Local engine is shutdown OK");\r
- ExecutableWrapper.shutdownService();\r
- log.info("Individual executables stream engine is shutdown OK");\r
+ executor.shutdown();\r
+ executor.awaitTermination(3, TimeUnit.SECONDS);\r
+ } catch (InterruptedException e) {\r
+ log.warn(e.getMessage(), e);\r
+ }\r
+\r
+ // Shutdown local and cluster engines\r
+ log.info("JABAWS context is destroyed. Shutting down engines...");\r
+ LocalExecutorService.shutDown();\r
+ log.info("Local engine is shutdown OK");\r
+ ExecutableWrapper.shutdownService();\r
+ log.info("Individual executables stream engine is shutdown OK");\r
+ StatDB.shutdownDBServer();\r
}\r
\r
@Override\r
boolean cleanClasterDir = PropertyHelperManager.getBooleanProperty(ph.getProperty("cluster.stat.collector.enable"));\r
\r
if (0 < clusterDirLifespan && cleanClasterDir) {\r
- DirCleaner clusterDirCleaner = new DirCleaner( clusterWorkDir, clusterDirLifespan);\r
+ DirCleaner clusterDirCleaner = new DirCleaner(clusterWorkDir, clusterDirLifespan);\r
clustercl = executor.scheduleAtFixedRate(clusterDirCleaner, 1, clusterCleaningRate, TimeUnit.MINUTES);\r
log.info("Cleaning local job directory every " + clusterCleaningRate + " minutes");\r
} else {\r
boolean cleanLocalDir = PropertyHelperManager.getBooleanProperty(ph.getProperty("local.stat.collector.enable"));\r
\r
if (0 < localDirLiveSpan && cleanLocalDir) {\r
- DirCleaner localDirCleaner = new DirCleaner( localWorkDir, localDirLiveSpan);\r
+ DirCleaner localDirCleaner = new DirCleaner(localWorkDir, localDirLiveSpan);\r
localcl = executor.scheduleAtFixedRate(localDirCleaner, 1, localCleaningRate, TimeUnit.MINUTES);\r
log.info("Cleaning local job directory every " + localCleaningRate + " minutes");\r
} else {\r