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;
/**
* Constructs the subsystem.
+ * @param aRegistry Registry of services.
* @param aName Name of the system.
* @param aProvided Provided services.
* @param aRequired Required services.
}
@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]);
}
* 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