some major refactoring.
[utils] / system / general / src / main / java / org / wamblee / system / Component.java
index 6a31e01d61748002d63a435ac0da55f56ca66733..4083c5bd6fc9e28f2e4b04e096e659d06b5d0d9b 100644 (file)
@@ -8,6 +8,16 @@ package org.wamblee.system;
  */
 public interface Component {
        
+       enum Status { 
+               NOT_STARTED, RUNNING, STOPPED
+       }
+       
+       /**
+        * Gets the status of the component. 
+        * @return Status. 
+        */
+       Status getStatus();
+       
        /**
         * Gets the name of the subsystem.
         * @return Subsystem name. 
@@ -18,24 +28,21 @@ public interface Component {
         * Gets a description of the provided interfaces. 
         * @return Provided interfaces. 
         */
-       ProvidedInterfaceDescriptor[] getProvidedServices();
+       ProvidedInterface[] getProvidedServices();
        
        /**
         * Gets a description of the required interfaces. 
         * @return Required interfaces. 
         */
-       RequiredInterfaceDescriptor[] getRequiredServices();
+       RequiredInterface[] getRequiredServices();
 
        
        /**
         * Initialises the subsytem by starting all the services that
         * it described as provided. 
-        * @param aContext Unique name for the subsystem. 
-        * @param aRequiredServices Running services from other 
-        * subsystems that are required by this subsystem. 
-        * @return Services that are running in the subsystem. 
+        * @param aContext Unique name for the subsystem.  
         */
-       Service[] start(String aContext, Service[] aRequiredServices);
+       void start(String aContext);
        
        /**
         * Stops a subsystem. 
@@ -49,5 +56,5 @@ public interface Component {
         * {@link #initialize(String, Service[])} has been called. 
         * @return
         */
-       Service[] getRunningServices();
+       ProvidedInterface[] getRunningServices();
 }