|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object toolbox.services.ServiceRegistryImpl
public class ServiceRegistryImpl
The default ServiceRegistry
implementation.
All service and environment dependencies are defined in an XML configuration document.
Constructor Summary | |
---|---|
ServiceRegistryImpl()
Default constructor |
Method Summary | |
---|---|
void |
destroy()
Destroy this registry, by destroy all the singleton services and all service environments. |
java.lang.String |
getProperty(java.lang.String name)
Return the value of the named registry configuration property. |
java.lang.Object |
getService(java.lang.String name,
java.lang.Class clazz)
Create and return an instance of the named service. |
void |
init(java.lang.String name,
java.lang.String config)
Initialise this registry by reading the registry configuration. |
void |
loadEnvironment(java.lang.String name)
Force the registry to load the named environment. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ServiceRegistryImpl()
Method Detail |
---|
public void init(java.lang.String name, java.lang.String config) throws ServiceException
init
in interface ServiceRegistry
name
- Registry name.config
- Location of the registry configuration.
ServiceException
- if the registry configuration cannot be
created.public java.lang.Object getService(java.lang.String name, java.lang.Class clazz) throws ServiceException
getService
in interface ServiceRegistry
name
- String containing the name or identifier for the service.clazz
- The class that represents the service type or
implementation.
ServiceException
- if the service cannot be created and returned.public void loadEnvironment(java.lang.String name) throws ServiceException
loadEnvironment
in interface ServiceRegistry
name
- String containing the name of the environment to load.
ServiceException
- if the environment cannot be loaded.public java.lang.String getProperty(java.lang.String name)
getProperty
in interface ServiceRegistry
name
- String containing property name.
public void destroy() throws ServiceException
destroy
in interface ServiceRegistry
ServiceException
- if the registry cannot be destroy.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |