|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
ServiceManager defines an interface for classes that manage
a set of Service implementations. This interface extends
the Lifecycle interface, which provides a means to start and
stop the ServiceManager including any Services managed by it that also
implement the Lifecycle interface.
| Field Summary |
| Fields inherited from interface com.cafesoft.core.lifecycle.Lifecycle |
START_EVENT, STOP_EVENT |
| Method Summary | |
void |
add(Class type,
Service service)
Add a Service to the registry. |
Service[] |
getServices()
Returns all of the Services in the registry. |
Service[] |
lookup(Class type)
Lookup Services from the registry by type. |
Service |
lookup(String id)
Lookup a Service from the registry by unique identifier. |
Service |
lookup(String id,
Class type)
Lookup a Service from the registry by unique identifier and type. |
void |
remove(Service service)
Remove a Service from the registry. |
void |
setServiceStarter(ServiceStarter serviceStarter)
Set a ServiceStarter. |
void |
setServiceStopper(ServiceStopper serviceStopper)
Set a ServiceStopper. |
| Methods inherited from interface com.cafesoft.core.service.Service |
destroy, getServiceConfig, initialize |
| Methods inherited from interface com.cafesoft.core.util.Debuggable |
setDebug |
| Methods inherited from interface com.cafesoft.core.lifecycle.Lifecycle |
addLifecycleListener, isStarted, removeLifecycleListener, start, stop |
| Method Detail |
public void add(Class type,
Service service)
throws ServiceException
type - the Class that identifies the type of service.service - the Service to be added.
ServiceException - if the service is already
registered.
public void remove(Service service)
throws ServiceException
service - the Service to be removed.
ServiceException - if the service is not
registered.public Service[] getServices()
public Service[] lookup(Class type)
throws ServiceException
type - the Service Class.
ServiceException - if no service with the specified type is
registered.
public Service lookup(String id)
throws ServiceException
id - the Service identifier.
ServiceException - if no service with the specified
identifier is registered.
public Service lookup(String id,
Class type)
throws ServiceException
id - the Service identifier.type - the Service type.
ServiceException - if no service with the specified
identifier and type is registered.public void setServiceStarter(ServiceStarter serviceStarter)
serviceStarter - the ServiceStarter that will handle startup of
Service instances when this ServiceManager is started, or null if
the default ServiceManager startup behaviour is desired.public void setServiceStopper(ServiceStopper serviceStopper)
serviceStopper - the ServiceStopper that will handle stopping of
Service instances when this ServiceManager is stopped, or null if
the default ServiceManager stopping behaviour is desired.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||