(no commit message)
[utils] / system / general / src / main / java / org / wamblee / system / AbstractSubSystem.java
index 0837d5f67f233ffe6c7d9e5ddd6c73bf52d05917..06fd5bb82c823aa3481e278753a6338504919c66 100644 (file)
@@ -16,7 +16,7 @@ import org.apache.commons.logging.LogFactory;
 public abstract class AbstractSubSystem implements SubSystem {
        
        private static final Log LOG = LogFactory.getLog(AbstractSubSystem.class);
-       
+
        private String _name; 
        private List<ServiceDescriptor> _provided;
        private List<ServiceDescriptor> _required;
@@ -24,6 +24,7 @@ public abstract class AbstractSubSystem implements SubSystem {
        
        /**
         * Constructs the subsystem. 
+        * @param aRegistry Registry of services. 
         * @param aName Name of the system. 
         * @param aProvided Provided services. 
         * @param aRequired Required services. 
@@ -54,9 +55,9 @@ public abstract class AbstractSubSystem implements SubSystem {
        }
 
        @Override
-       public final Service[] initialize(String aContext, Service[] aRequiredServices) {
+       public final Service[] start(String aContext, ServiceRegistry aRegistry, Service[] aRequiredServices) {
                LOG.info("Initializing '" + aContext + "." + _name + "' with " + Arrays.asList(aRequiredServices));
-               doInitialize(aContext + "." + getName(), aRequiredServices); 
+               doStart(aContext + "." + getName(), aRegistry, aRequiredServices); 
                return _running.values().toArray(new Service[0]);
        }
        
@@ -64,10 +65,11 @@ public abstract class AbstractSubSystem implements SubSystem {
         * Must be implemented for initializing the subsystem. 
         * The implementation must call {@link #addService(Service)}
         * for each service that is started. 
+        * @param aRegistry Registry to which the subsystem must register its services. 
         * @param aRequiredServices Services that are already running
         * from other subsystems that may be used. 
         */
-       protected abstract void doInitialize(String aContext, Service[] aRequiredServices); 
+       protected abstract void doStart(String aContext, ServiceRegistry aRegistry, Service[] aRequiredServices); 
        
        /**
         * Implementations must call this method to indicate that