You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by lr...@apache.org on 2007/09/25 22:11:40 UTC

svn commit: r579364 - /incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/CompositeActivatorImpl.java

Author: lresende
Date: Tue Sep 25 13:11:39 2007
New Revision: 579364

URL: http://svn.apache.org/viewvc?rev=579364&view=rev
Log:
TUSCANY-1756 - Applying patch from WangFeng

Modified:
    incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/CompositeActivatorImpl.java

Modified: incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/CompositeActivatorImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/CompositeActivatorImpl.java?rev=579364&r1=579363&r2=579364&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/CompositeActivatorImpl.java (original)
+++ incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/CompositeActivatorImpl.java Tue Sep 25 13:11:39 2007
@@ -442,6 +442,10 @@
             logger.fine("Starting component: " + component.getURI());
         }
         RuntimeComponent runtimeComponent = ((RuntimeComponent)component);
+        if(runtimeComponent.isStarted()) {
+        	return;
+        }
+        
         configureComponentContext(runtimeComponent);
 
         for (ComponentReference reference : component.getReferences()) {
@@ -505,6 +509,9 @@
      * Stop a component
      */
     public void stop(Component component) {
+    	if (!((RuntimeComponent)component).isStarted()) {
+    		return;
+        }
         if (logger.isLoggable(Level.FINE)) {
             logger.fine("Stopping component: " + component.getURI());
         }
@@ -543,7 +550,8 @@
 
         if (component instanceof ScopedRuntimeComponent) {
             ScopedRuntimeComponent runtimeComponent = (ScopedRuntimeComponent)component;
-            if (runtimeComponent.getScopeContainer() != null) {
+            if (runtimeComponent.getScopeContainer() != null && 
+            		runtimeComponent.getScopeContainer().getLifecycleState() != ScopeContainer.STOPPED) {
                 runtimeComponent.getScopeContainer().stop();
             }
         }



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