X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;f=system%2Fgeneral%2Fsrc%2Fmain%2Fjava%2Forg%2Fwamblee%2Fsystem%2Fcore%2FComponent.java;h=d14eb08a2364891205aef8647b47446e8df66f0a;hb=fc10e15e031cf409146b04cbb5e98b649c6ccddc;hp=ff80ee693acdcba8f70443cf4bb704ba4821a2d5;hpb=d89a08c127770dfe9b25e88495c7545bbcc938fa;p=utils diff --git a/system/general/src/main/java/org/wamblee/system/core/Component.java b/system/general/src/main/java/org/wamblee/system/core/Component.java index ff80ee69..d14eb08a 100644 --- a/system/general/src/main/java/org/wamblee/system/core/Component.java +++ b/system/general/src/main/java/org/wamblee/system/core/Component.java @@ -17,11 +17,19 @@ package org.wamblee.system.core; /** * A component represents a part of a system that requires a - * number of interfaces and provides a number of interfaces. + * number of interfaces and provides a number of interfaces. + * + * The component interface provides the meta-data for a component. + * After calling {@link #start(Scope)}, an actual runtime representation of the + * component can be created which is independent of this component. + * As a special case, the runtime representation may be identical to the + * component instance but in general it is not. This allows a component to be + * used as a factory for creating objects. + * * * @author Erik Brakkee */ -public interface Component { +public interface Component { /** * Gets the name of the subsystem. @@ -56,22 +64,18 @@ public interface Component { /** - * Initialises the subsytem by starting all the services that - * it described as provided. - */ - void start(); - - /** - * Gets the list of running services in the subsystem. - * - * This method may only be called after the - * {@link #initialize(String, Service[])} has been called. - * @return + * Initialises the subsystem by starting all the services that + * it described as provided. + * @param aScope Scope with external interface implementations that are available. The component + * implementation can either oublish itself in this scope or it can decide to + * create a new scope with the scope passed in as a parent. + * @return Gets an object representing the runtime of the component. */ - ProvidedInterface[] getRunningInterfaces(); + Type start(Scope aScope); /** - * Stops a subsystem. + * Stops a component. + * @param aRuntime THe runtime part of the component. */ - void stop(); + void stop(Type aRuntime); }