|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.exolab.core.service.ServiceGroup
ServiceGroup is responsible for managing a collection of
Serviceable
objects.
All serviceable objects are named and no two sevices can have the same
name.
BasicService
,
Service
,
Serviceable
Constructor Summary | |
ServiceGroup()
Create a new service group |
Method Summary | |
void |
add(java.lang.String name,
Serviceable service)
Add the named service to the collection of managed services. |
Serviceable |
getServiceByName(java.lang.String name)
Return the service specified by name, or null if one does not exist |
java.util.Iterator |
getServiceNames()
Return an enumeration of the registered service names |
void |
remove(Serviceable service)
Remove the specified service from the ServiceGroup. |
void |
remove(java.lang.String name)
Remove the named service from the ServiceGroup. |
void |
removeAll()
Remove all registered services. |
void |
startAll()
Start all the services in their registered order. |
void |
stopAll()
Stop all the services in their reverse registered order. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ServiceGroup()
Method Detail |
public void add(java.lang.String name, Serviceable service) throws ServiceAlreadyExistsException, ServiceManagerException
The startAll()
method will start the services in the order that
they were added to the ServiceGroup. Therefore if one service is
dependent on another ensure that they are added in the correct order.
Similarly stopAll()
will stop the services in the reverse order
to which they were started.
name
- the name of the seviceservice
- the service to add
ServiceAlreadyExistsException
- if a service exists with the same
name
ServiceManagerException
- if the service is not in the stopped
statepublic void remove(java.lang.String name) throws ServiceDoesNotExistException, ServiceManagerException
name
- the name of the service to remove
ServiceDoesNotExistException
- if the named service doesn't exist
ServiceManagerException
- if a client tries to remove a service
that is not stopped.public void remove(Serviceable service) throws ServiceDoesNotExistException, ServiceManagerException
service
- the service to remove
ServiceDoesNotExistException
- if the service isn't registered
ServiceManagerException
- if a client tries to remove a service
that is not stopped.public java.util.Iterator getServiceNames()
public Serviceable getServiceByName(java.lang.String name)
name
- the service name
public void startAll() throws ServiceManagerException
ServiceManagerException
public void stopAll()
public void removeAll()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |