(no commit message)
[utils] / system / general / src / main / java / org / wamblee / system / container / Container.java
index dc45dd7d0ef7e1f5d70fd7fecf3cc2abbe1dd4fb..fe744f74c8be805d95842588e173b724a7091e22 100644 (file)
@@ -31,11 +31,10 @@ import org.wamblee.system.core.RequiredInterface;
 import org.wamblee.system.core.Scope;
 import org.wamblee.system.core.SystemAssemblyException;
 import org.wamblee.system.graph.CompositeEdgeFilter;
-import org.wamblee.system.graph.EdgeFilter;
 import org.wamblee.system.graph.component.ComponentGraph;
+import org.wamblee.system.graph.component.ConnectExternalProvidedProvidedFilter;
 import org.wamblee.system.graph.component.ConnectRequiredExternallyRequiredEdgeFilter;
 import org.wamblee.system.graph.component.ConnectRequiredProvidedEdgeFilter;
-import org.wamblee.system.graph.component.RequiredProvidedEdgeFactory;
 
 /**
  * Container consisting of multiple components.
@@ -111,6 +110,7 @@ public class Container extends AbstractComponent<Scope> {
     public void connectRequiredProvided(String aClientComponent, String aRequiredInterface, 
             String aServerComponent, String aProvidedInterface) {
         checkSealed();
+        // TODO validate 
         _edgeFilter.add(new ConnectRequiredProvidedEdgeFilter(aClientComponent, aRequiredInterface, aServerComponent, aProvidedInterface));
     }
     
@@ -123,14 +123,15 @@ public class Container extends AbstractComponent<Scope> {
     public void connectExternalRequired(String aComponent, String aRequiredInterface, 
             String aExternalRequiredInterface) {
         checkSealed();
+        // TODO validate
         _edgeFilter.add(new ConnectRequiredExternallyRequiredEdgeFilter(
                 aComponent, aRequiredInterface, aExternalRequiredInterface));
     }
     
     public void connectExternalProvided(String aExternalProvided, String aComponent, String aProvidedInterface) {
         checkSealed();
-        // TODO implement. 
-        throw new RuntimeException("not implemented"); 
+        // TODO validate
+        _edgeFilter.add(new ConnectExternalProvidedProvidedFilter(aExternalProvided, aComponent, aProvidedInterface));
     }
 
 
@@ -193,7 +194,7 @@ public class Container extends AbstractComponent<Scope> {
      * @return Scope.
      */
     public Scope start() {
-        Scope scope = new DefaultScope(getProvidedInterfaces());
+        Scope scope = new DefaultScope(getProvidedInterfaces().toArray());
         return super.start(scope);
     }
 
@@ -201,7 +202,7 @@ public class Container extends AbstractComponent<Scope> {
     protected Scope doStart(Scope aExternalScope) {
         checkSealed();
         validate();
-        Scope scope = new DefaultScope(getProvidedInterfaces(), aExternalScope);
+        Scope scope = new DefaultScope(getProvidedInterfaces().toArray(), aExternalScope);
         ComponentGraph graph = doStartOptionalDryRun(scope, false);
         exposeProvidedInterfaces(graph, aExternalScope, scope);
         seal();