|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.exolab.jms.service.Service
org.exolab.jms.service.ServiceManager
public class ServiceManager
Default implementation of the Services
interface.
Service
,
Serviceable
Constructor Summary | |
---|---|
ServiceManager()
Construct a new ServiceManager . |
Method Summary | |
---|---|
void |
addService(java.lang.Class type)
Add a service of the specified type. |
void |
addService(java.lang.Object service)
Add a service instance. |
protected void |
checkExists(java.lang.Class type)
Checks if a service has been registered. |
protected java.lang.Object |
createService(java.lang.Class type,
java.util.LinkedList creating,
java.util.List created)
Create a new service given its type. |
protected void |
doStart()
Start the service. |
protected void |
doStop()
Stop the service. |
java.lang.Object |
getService(java.lang.Class type)
Returns a service given its type. |
Methods inherited from class org.exolab.jms.service.Service |
---|
getName, isStarted, restart, start, stop, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.exolab.jms.service.Serviceable |
---|
start, stop |
Constructor Detail |
---|
public ServiceManager()
ServiceManager
.
Method Detail |
---|
public void addService(java.lang.Class type) throws ServiceException
getService(java.lang.Class)
.
addService
in interface Services
type
- the type of the service
ServiceAlreadyExistsException
- if the service already exists
ServiceException
- for any service errorpublic void addService(java.lang.Object service) throws ServiceException
addService
in interface Services
service
- the service instance
ServiceAlreadyExistsException
- if the service already exists
ServiceException
- for any service errorpublic java.lang.Object getService(java.lang.Class type) throws ServiceException
getService
in interface Services
type
- the type of the service
type
ServiceDoesNotExistException
- if the service doesn't exist, or is
dependent on a service which doesn't
exist
ServiceException
- for any service errorprotected void doStart() throws ServiceException
doStart
in class Service
ServiceException
- if the service fails to start, or is already
runningprotected void doStop() throws ServiceException
doStop
in class Service
ServiceException
- if the service fails to stop, or is already
stoppedprotected java.lang.Object createService(java.lang.Class type, java.util.LinkedList creating, java.util.List created) throws ServiceException
type
- the service typecreating
- the set of services currently being createdcreated
- the set of services already created
type
- Throws:
ServiceException
- if the service can't be constructed
protected void checkExists(java.lang.Class type) throws ServiceAlreadyExistsException
type
- the type of the service
ServiceAlreadyExistsException
- if the service is already
registered
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |