/**
* 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<Type> {
/**
* Gets the name of the subsystem.
/**
- * 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);
}