X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;f=system%2Fgeneral%2Fsrc%2Fmain%2Fjava%2Forg%2Fwamblee%2Fsystem%2Fcontainer%2FContainer.java;h=fe744f74c8be805d95842588e173b724a7091e22;hb=61f321c26b854960fc375c8a8c58cb0573c0f1ce;hp=59067f974f2835d6980078ab8b240a518e628d58;hpb=102eebeba2200f9bb2d8523bdfe7ace4ff663628;p=utils diff --git a/system/general/src/main/java/org/wamblee/system/container/Container.java b/system/general/src/main/java/org/wamblee/system/container/Container.java index 59067f97..fe744f74 100644 --- a/system/general/src/main/java/org/wamblee/system/container/Container.java +++ b/system/general/src/main/java/org/wamblee/system/container/Container.java @@ -31,10 +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. @@ -110,20 +110,28 @@ public class Container extends AbstractComponent { public void connectRequiredProvided(String aClientComponent, String aRequiredInterface, String aServerComponent, String aProvidedInterface) { checkSealed(); + // TODO validate _edgeFilter.add(new ConnectRequiredProvidedEdgeFilter(aClientComponent, aRequiredInterface, aServerComponent, aProvidedInterface)); } + /** + * Explicitly connects a externally required interface to an internally required interface. + * @param aComponent Component requiring the interface (must be non-null). + * @param aRequiredInterface Required interface of the component (must be non-null). + * @param aExternalRequiredInterface Externally required interface (must be non-null). + */ public void connectExternalRequired(String aComponent, String aRequiredInterface, String aExternalRequiredInterface) { checkSealed(); - // TODO implement. - throw new RuntimeException("not implemented"); + // 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)); } @@ -186,7 +194,7 @@ public class Container extends AbstractComponent { * @return Scope. */ public Scope start() { - Scope scope = new DefaultScope(getProvidedInterfaces()); + Scope scope = new DefaultScope(getProvidedInterfaces().toArray()); return super.start(scope); } @@ -194,7 +202,7 @@ public class Container extends AbstractComponent { 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();