|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.xbean.kernel.standard.ServiceManagerRegistry
public class ServiceManagerRegistry
The StandardServiceRegistry manages the registration of ServiceManagers for the kernel.
Constructor Summary | |
---|---|
ServiceManagerRegistry(ServiceManagerFactory serviceManagerFactory)
Creates a ServiceManagerRegistry that uses the specified service manager factory to create new service managers. |
Method Summary | |
---|---|
void |
destroy()
Stops and destroys all services service managers. |
Object |
getService(Class type)
Gets the first registed and running service that is an instance of the specified type, or null if no instances of the specified type are running. |
ServiceManager |
getServiceManager(Class type)
Gets the first registered service manager that creates an instance of the specified type, or null if no service managers create an instance of the specified type. |
ServiceManager |
getServiceManager(ServiceName serviceName)
Gets the service manager registered under the specified name. |
List |
getServiceManagers(Class type)
Gets all service managers that create an instances of the specified type, or an empty list if no service managers create an instance of the specified type. |
List |
getServices(Class type)
Gets the all of running service that are an instances of the specified type, or an empty list if no instances of the specified type are running. |
boolean |
isRegistered(ServiceName serviceName)
Determines if there is a service registered under the specified name. |
void |
registerService(ServiceName serviceName,
ServiceFactory serviceFactory)
Creates a ServiceManager and registers it under the specified name. |
void |
unregisterService(ServiceName serviceName,
StopStrategy stopStrategy)
Stops and destorys the ServiceManager and then unregisters it. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ServiceManagerRegistry(ServiceManagerFactory serviceManagerFactory)
serviceManagerFactory
- the factory for new service managersMethod Detail |
---|
public void destroy() throws KernelErrorsError
KernelErrorsError
- if any errors occur while stopping or destroying the service managerspublic boolean isRegistered(ServiceName serviceName)
serviceName
- the unique name of the service
public ServiceManager getServiceManager(ServiceName serviceName) throws ServiceNotFoundException
serviceName
- the unique name of the service
ServiceNotFoundException
- if there is no service registered under the specified namepublic ServiceManager getServiceManager(Class type)
type
- the of the desired service
public List getServiceManagers(Class type)
type
- the of the desired service managers
public Object getService(Class type)
type
- the of the desired service
public List getServices(Class type)
type
- the of the desired service
public void registerService(ServiceName serviceName, ServiceFactory serviceFactory) throws ServiceAlreadyExistsException, ServiceRegistrationException
serviceName
- the unique name of the serviceserviceFactory
- the factory used to create the service
ServiceAlreadyExistsException
- if service is already registered with the specified name
ServiceRegistrationException
- if the service is not restartable and an error occured while starting the servicepublic void unregisterService(ServiceName serviceName, StopStrategy stopStrategy) throws ServiceNotFoundException, ServiceRegistrationException
serviceName
- the unique name of the servicestopStrategy
- the strategy that determines how unsatisfied conditions are handled
ServiceNotFoundException
- if there is no service registered under the specified name
ServiceRegistrationException
- if the service could not be stopped
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |