summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk
diff options
context:
space:
mode:
authorslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2010-01-15 11:22:04 +0000
committerslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2010-01-15 11:22:04 +0000
commit58c05607b4bd7fbeaa35376b2046c7f2bc1a1a1e (patch)
tree01a41e3cab8ab32ed6ca6f91f5d3d402e8d55a53 /sca-java-2.x/trunk
parentf1e07cf238256d035518815a9b15050125c6e266 (diff)
Fix to make OTEST JCA_2005 work again. This is an @EagerInit scenario and out code was starting scope containers before all endpoints had been registered. With all matching going through the binding/registry now this meant that the reference being used inside the @EagerInit failed to resolve. This change moves the scope container start to after the services are registered.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@899599 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk')
-rw-r--r--sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/CompositeActivatorImpl.java25
1 files changed, 18 insertions, 7 deletions
diff --git a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/CompositeActivatorImpl.java b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/CompositeActivatorImpl.java
index 58ffb0f9b9..d9c6eec137 100644
--- a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/CompositeActivatorImpl.java
+++ b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/CompositeActivatorImpl.java
@@ -299,6 +299,12 @@ public class CompositeActivatorImpl implements CompositeActivator {
for (Component component : composite.getComponents()) {
start(compositeContext, component);
}
+
+ for (Component component : composite.getComponents()) {
+ if (component instanceof ScopedRuntimeComponent) {
+ start(compositeContext, (ScopedRuntimeComponent)component);
+ }
+ }
}
public void stop(CompositeContext compositeContext, Composite composite) {
@@ -336,13 +342,8 @@ public class CompositeActivatorImpl implements CompositeActivator {
}
}
- if (component instanceof ScopedRuntimeComponent) {
- ScopedRuntimeComponent scopedRuntimeComponent = (ScopedRuntimeComponent)component;
- if (scopedRuntimeComponent.getScopeContainer() != null) {
- scopedRuntimeComponent.getScopeContainer().start();
- }
- }
- // Reference bindings aren't started until the wire is first used
+ // Reference bindings aren't started until the wire is first used although this may
+ // happen when the scope container is started in the case of @EagerInit
for (ComponentService service : component.getServices()) {
if (logger.isLoggable(Level.FINE)) {
@@ -369,6 +370,7 @@ public class CompositeActivatorImpl implements CompositeActivator {
}
}
}
+
runtimeComponent.setStarted(true);
}
@@ -456,6 +458,15 @@ public class CompositeActivatorImpl implements CompositeActivator {
((RuntimeComponent)component).setStarted(false);
}
+ // Scope container start/stop
+ // separate off from component start that all endpoints are
+ // registered before any @EagerInit takes place
+ public void start(CompositeContext compositeContext, ScopedRuntimeComponent scopedRuntimeComponent) {
+ if (scopedRuntimeComponent.getScopeContainer() != null) {
+ scopedRuntimeComponent.getScopeContainer().start();
+ }
+ }
+
// Service start/stop
// done as part of the component start above