tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jboy...@apache.org
Subject svn commit: r428191 - in /incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core: launcher/Launcher.java services/work/jsr237/workmanager/ThreadPoolWorkManager.java
Date Wed, 02 Aug 2006 23:33:24 GMT
Author: jboynes
Date: Wed Aug  2 16:33:24 2006
New Revision: 428191

URL: http://svn.apache.org/viewvc?rev=428191&view=rev
Log:
apply patch from Meeraj Kunnumpurath for problem with supplychain sample hanging

Modified:
    incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/launcher/Launcher.java
    incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/services/work/jsr237/workmanager/ThreadPoolWorkManager.java

Modified: incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/launcher/Launcher.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/launcher/Launcher.java?rev=428191&r1=428190&r2=428191&view=diff
==============================================================================
--- incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/launcher/Launcher.java
(original)
+++ incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/launcher/Launcher.java
Wed Aug  2 16:33:24 2006
@@ -57,6 +57,7 @@
     private ClassLoader applicationLoader;
     private RuntimeComponent runtime;
     private Deployer deployer;
+    private CompositeComponent<?> composite;
 
     /**
      * Returns the classloader for application classes.
@@ -112,7 +113,7 @@
                                                                        moduleImplementation);
 
         // deploy the component into the runtime under the system parent
-        CompositeComponent<?> composite = (CompositeComponent<?>) bootDeployer.deploy(parent,
moduleDefinition);
+        composite = (CompositeComponent<?>) bootDeployer.deploy(parent, moduleDefinition);
 
         // start the system
         composite.start();
@@ -125,11 +126,15 @@
      * Shuts down the active runtime being managed by this instance.
      */
     public void shutdownRuntime() {
+        if (composite != null) {
+            composite.stop();
+            composite = null;
+        }
+
         if (runtime != null) {
             runtime.stop();
+            runtime = null;
         }
-
-        runtime = null;
     }
 
     /**

Modified: incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/services/work/jsr237/workmanager/ThreadPoolWorkManager.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/services/work/jsr237/workmanager/ThreadPoolWorkManager.java?rev=428191&r1=428190&r2=428191&view=diff
==============================================================================
--- incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/services/work/jsr237/workmanager/ThreadPoolWorkManager.java
(original)
+++ incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/services/work/jsr237/workmanager/ThreadPoolWorkManager.java
Wed Aug  2 16:33:24 2006
@@ -20,10 +20,11 @@
 import java.util.Collection;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.Executor;
+import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.RejectedExecutionException;
 
+import org.osoa.sca.annotations.Destroy;
 import org.osoa.sca.annotations.Property;
 
 import commonj.work.Work;
@@ -48,7 +49,7 @@
     private Map<DefaultWorkItem, WorkListener> workItems = new ConcurrentHashMap<DefaultWorkItem,
WorkListener>();
 
     // Thread-pool
-    private Executor executor;
+    private ExecutorService executor;
 
     /**
      * Initializes the thread-pool.
@@ -207,6 +208,11 @@
             }
         }
 
+    }
+    
+    @Destroy
+    public void destroy() {
+    	executor.shutdown();
     }
 
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org


Mime
View raw message