X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;f=system%2Fgeneral%2Fsrc%2Fmain%2Fjava%2Forg%2Fwamblee%2Fsystem%2FAbstractSubSystem.java;h=06fd5bb82c823aa3481e278753a6338504919c66;hb=4c7e63f11337abfaa6ea13eab4b6ca11891f4977;hp=0837d5f67f233ffe6c7d9e5ddd6c73bf52d05917;hpb=35b19fe3a3158e865125153d53cd7d106ab2fae4;p=utils diff --git a/system/general/src/main/java/org/wamblee/system/AbstractSubSystem.java b/system/general/src/main/java/org/wamblee/system/AbstractSubSystem.java index 0837d5f6..06fd5bb8 100644 --- a/system/general/src/main/java/org/wamblee/system/AbstractSubSystem.java +++ b/system/general/src/main/java/org/wamblee/system/AbstractSubSystem.java @@ -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 _provided; private List _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