|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.xbean.kernel.standard.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. |
java.lang.Object |
getService(java.lang.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(java.lang.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. |
java.util.List |
getServiceManagers(java.lang.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. |
java.util.List |
getServices(java.lang.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,
java.lang.ClassLoader classLoader)
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(java.lang.Class type)
type
- the of the desired service
public java.util.List getServiceManagers(java.lang.Class type)
type
- the of the desired service managers
public java.lang.Object getService(java.lang.Class type)
type
- the of the desired service
public java.util.List getServices(java.lang.Class type)
type
- the of the desired service
public void registerService(ServiceName serviceName, ServiceFactory serviceFactory, java.lang.ClassLoader classLoader) throws ServiceAlreadyExistsException, ServiceRegistrationException
serviceName
- the unique name of the serviceserviceFactory
- the factory used to create the serviceclassLoader
- the class loader to use for this 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 |