|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.exolab.jms.service.Service | +--org.exolab.jms.service.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
The service will be constructed when it is first accessed via getService(java.lang.Class)
.
addService
in interface Services
type
- the type of the serviceServiceAlreadyExistsException
- if the service already existsServiceException
- for any service errorpublic void addService(java.lang.Object service) throws ServiceException
addService
in interface Services
service
- the service instanceServiceAlreadyExistsException
- if the service already existsServiceException
- for any service errorpublic java.lang.Object getService(java.lang.Class type) throws ServiceException
If the service has been registered but not constructed, it will be created and any setters populated.
getService
in interface Services
type
- the type of the servicetype
ServiceDoesNotExistException
- if the service doesn't exist, or is
dependent on a service which doesn't
existServiceException
- 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 createdtype
Throws:
ServiceException
- if the service can't be constructed
checkExists
protected void checkExists(java.lang.Class type)
throws ServiceAlreadyExistsException
- Checks if a service has been registered.
- Parameters:
type
- the type of the service- Throws:
ServiceAlreadyExistsException
- if the service is already
registered
Overview
Package
Class
Use
Tree
Deprecated
Index
Help
PREV CLASS
NEXT CLASS
FRAMES
NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD
Copyright © 1999-2007 The OpenJMS Group. All Rights Reserved.