Related to issue 30798: Lots of errors in log during tomcat shutdown related to new import entry project
authorMartin Taal <martin.taal@openbravo.com>
Sun, 15 Nov 2015 12:50:48 +0100
changeset 28106 3af928301873
parent 28105 12dfd7922c07
child 28107 d816f0fd4dd9
Related to issue 30798: Lots of errors in log during tomcat shutdown related to new import entry project
Added additional checks to prevent log errors
src/org/openbravo/service/importprocess/ImportEntryArchiveManager.java
src/org/openbravo/service/importprocess/ImportEntryManager.java
--- a/src/org/openbravo/service/importprocess/ImportEntryArchiveManager.java	Sun Nov 15 12:49:47 2015 +0100
+++ b/src/org/openbravo/service/importprocess/ImportEntryArchiveManager.java	Sun Nov 15 12:50:48 2015 +0100
@@ -85,6 +85,9 @@
   }
 
   public void shutdown() {
+    if (executorService == null) {
+      return;
+    }
     isShutDown = true;
     log.debug("Shutting down Import Entry Archive Framework");
     executorService.shutdownNow();
--- a/src/org/openbravo/service/importprocess/ImportEntryManager.java	Sun Nov 15 12:49:47 2015 +0100
+++ b/src/org/openbravo/service/importprocess/ImportEntryManager.java	Sun Nov 15 12:50:48 2015 +0100
@@ -224,11 +224,16 @@
    * Shutdown all the threads being used by the import framework
    */
   public void shutdown() {
+    if (!threadsStarted) {
+      return;
+    }
     log.debug("Shutting down Import Entry Framework");
 
     isShutDown = true;
 
-    executorService.shutdownNow();
+    if (executorService != null) {
+      executorService.shutdownNow();
+    }
 
     for (ImportEntryProcessor importEntryProcessor : importEntryProcessors.values()) {
       importEntryProcessor.shutdown();