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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]