You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by rf...@apache.org on 2007/05/08 07:48:46 UTC

svn commit: r536063 - in /incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core: runtime/DefaultCompositeActivator.java scope/AbstractScopeContainer.java scope/CompositeScopeContainer.java

Author: rfeng
Date: Mon May  7 22:48:45 2007
New Revision: 536063

URL: http://svn.apache.org/viewvc?view=rev&rev=536063
Log:
Start the scope container after the component has been started

Modified:
    incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/runtime/DefaultCompositeActivator.java
    incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/scope/AbstractScopeContainer.java
    incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/scope/CompositeScopeContainer.java

Modified: incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/runtime/DefaultCompositeActivator.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/runtime/DefaultCompositeActivator.java?view=diff&rev=536063&r1=536062&r2=536063
==============================================================================
--- incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/runtime/DefaultCompositeActivator.java (original)
+++ incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/runtime/DefaultCompositeActivator.java Mon May  7 22:48:45 2007
@@ -96,13 +96,6 @@
     protected void startComposite(Composite composite) {
         for (Component component : composite.getComponents()) {
             
-            if (component instanceof RuntimeComponent) {
-                RuntimeComponent runtimeComponent = (RuntimeComponent)component;
-                if (runtimeComponent.getScopeContainer() != null) {
-                    runtimeComponent.getScopeContainer().start();
-                }
-            }
-
             for (ComponentService service : component.getServices()) {
                 for (Binding binding : service.getBindings()) {
                     if (binding instanceof ServiceBindingActivator) {
@@ -125,6 +118,14 @@
             } else if (implementation instanceof ImplementationActivator) {
                 ((ImplementationActivator)implementation).start((RuntimeComponent)component);
             }
+
+            if (component instanceof RuntimeComponent) {
+                RuntimeComponent runtimeComponent = (RuntimeComponent)component;
+                if (runtimeComponent.getScopeContainer() != null) {
+                    runtimeComponent.getScopeContainer().start();
+                }
+            }
+            
         }
 
     }
@@ -154,13 +155,6 @@
     public void stop(Composite composite) {
         for (Component component : composite.getComponents()) {
             
-            if (component instanceof RuntimeComponent) {
-                RuntimeComponent runtimeComponent = (RuntimeComponent)component;
-                if (runtimeComponent.getScopeContainer() != null) {
-                    runtimeComponent.getScopeContainer().stop();
-                }
-            }
-            
             for (ComponentService service : component.getServices()) {
                 for (Binding binding : service.getBindings()) {
                     if (binding instanceof ServiceBindingActivator) {
@@ -183,6 +177,15 @@
             } else if (implementation instanceof ImplementationActivator) {
                 ((ImplementationActivator)implementation).stop((RuntimeComponent)component);
             }
+
+            if (component instanceof RuntimeComponent) {
+                RuntimeComponent runtimeComponent = (RuntimeComponent)component;
+                if (runtimeComponent.getScopeContainer() != null) {
+                    runtimeComponent.getScopeContainer().stop();
+                }
+            }
+            
+            
         }
 
     }

Modified: incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/scope/AbstractScopeContainer.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/scope/AbstractScopeContainer.java?view=diff&rev=536063&r1=536062&r2=536063
==============================================================================
--- incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/scope/AbstractScopeContainer.java (original)
+++ incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/scope/AbstractScopeContainer.java Mon May  7 22:48:45 2007
@@ -112,6 +112,13 @@
     }
 
     public void startContext(KEY contextId) throws GroupInitializationException {
+        if(isEagerInit()) {
+            try {
+                getWrapper(contextId);
+            } catch (TargetResolutionException e) {
+                // 
+            }
+        }
     }
 
     public synchronized void stop() {

Modified: incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/scope/CompositeScopeContainer.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/scope/CompositeScopeContainer.java?view=diff&rev=536063&r1=536062&r2=536063
==============================================================================
--- incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/scope/CompositeScopeContainer.java (original)
+++ incubator/tuscany/java/sca/modules/core/src/main/java/org/apache/tuscany/core/scope/CompositeScopeContainer.java Mon May  7 22:48:45 2007
@@ -55,4 +55,16 @@
         }
         return wrapper;
     }
+
+    @Override
+    public synchronized void start() {
+        super.start();
+        if(isEagerInit()) {
+            try {
+                getWrapper(null);
+            } catch (TargetResolutionException e) {
+                throw new IllegalStateException(e);
+            }
+        }
+    }
 }



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