|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ServiceRegistry
Interface that defines a service registry.
The registry is the heart of the services package. Registry implementations must manage the service lifecycle and manage the relationship between services and their corresponding environments.
Method Summary | |
---|---|
void |
destroy()
Destroy this registry. |
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. |
void |
loadEnvironment(java.lang.String name)
Force the registry to load the named environment. |
Method Detail |
---|
void init(java.lang.String name, java.lang.String config) throws ServiceException
name
- String containing the registry name.config
- File path to the configuration of this registry. The
configuration should define all the services supported
by this registry.
ServiceException
- if the registry cannot be created.java.lang.Object getService(java.lang.String name, java.lang.Class clazz) throws ServiceException
This method must handle the instantiation of the service and inject
the required service environment and configuration properties into
the service. The injection is done using the create(..)
method defined in the Service
interface.
name
- String containing the name or identifier for the services.clazz
- The class that is the implementation of the service.
ServiceException
- if the service cannot be created and returned.void loadEnvironment(java.lang.String name) throws ServiceException
name
- String containing the name of the environment to load.
ServiceException
- if the environment cannot be loaded.java.lang.String getProperty(java.lang.String name)
name
- String containing property name.
void destroy() throws ServiceException
ServiceException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |