|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.turbine.services.BaseInitableBroker | +--org.apache.turbine.services.BaseServiceBroker
A generic implementation of a ServiceBroker
.
Functionality that ServiceBroker
provides in addition
to InitableBroker
functionality includes:
Services
with Properties
based on system wide configuration mechanism.
Field Summary | |
protected org.apache.stratum.configuration.Configuration |
mapping
Mapping of Service names to class names. |
protected java.util.Hashtable |
services
A repository of Service instances. |
Fields inherited from class org.apache.turbine.services.BaseInitableBroker |
initables, stack |
Constructor Summary | |
protected |
BaseServiceBroker()
Default constructor of InitableBorker. |
Method Summary | |
private void |
doInitService(java.lang.Object data,
java.lang.String name)
Internal utility method for use in initServices() to prevent duplication of code. |
org.apache.stratum.configuration.Configuration |
getConfiguration(java.lang.String name)
Returns the Configuration of a specific service. |
java.util.Properties |
getProperties(java.lang.String name)
Returns the properites of a specific service. |
Service |
getService(java.lang.String name)
Returns an instance of requested Service. |
protected Service |
getServiceInstance(java.lang.String name)
Retrieves an instance of a Service without triggering late initialization. |
void |
initService(java.lang.String name,
java.lang.Object data)
Performs early initialization of specified service. |
void |
initServices(java.lang.Object data)
Performs early initialization of all services. |
void |
initServices(java.lang.Object data,
boolean report)
Performs early initiailzation of all services. |
boolean |
isRegistered(java.lang.String serviceName)
Determines whether a service is registered in the configured TurbineResources.properties . |
void |
shutdownService(java.lang.String name)
Shuts down a Service . |
void |
shutdownServices()
Shuts down all Turbine services, releasing allocated resources and returning them to their initial (uninitailized) state. |
Methods inherited from class org.apache.turbine.services.BaseInitableBroker |
error, getInitable, getInitableInstance, initClass, notice, shutdownClass |
Methods inherited from class java.lang.Object |
|
Methods inherited from interface org.apache.turbine.services.InitableBroker |
getInitable, initClass, shutdownClass |
Field Detail |
protected org.apache.stratum.configuration.Configuration mapping
protected java.util.Hashtable services
Constructor Detail |
protected BaseServiceBroker()
Method Detail |
public boolean isRegistered(java.lang.String serviceName)
TurbineResources.properties
.isRegistered
in interface ServiceBroker
serviceName
- The name of the service whose existance to check.public void initService(java.lang.String name, java.lang.Object data) throws InitializationException
initService
in interface ServiceBroker
name
- The name of the service (generally the
SERVICE_NAME
constant of the service's interface
definition).data
- An object to use for initialization activities.InitializationException
- Initilaization of this
service was not successful.public void initServices(java.lang.Object data)
initServices
in interface ServiceBroker
data
- An Object to use for initialization activities.public void initServices(java.lang.Object data, boolean report) throws InstantiationException, InitializationException
data
- An Object to use for initialization activities.report
- true
if you want exceptions thrown.private void doInitService(java.lang.Object data, java.lang.String name) throws InstantiationException, InitializationException
public void shutdownService(java.lang.String name)
Service
.
This method is used to release resources allocated by a
Service, and return it to its initial (uninitailized) state.shutdownService
in interface ServiceBroker
name
- The name of the Service
to be uninitialized.public void shutdownServices()
shutdownServices
in interface ServiceBroker
public Service getService(java.lang.String name) throws InstantiationException
getService
in interface ServiceBroker
name
- The name of the Service requested.InstantiationException,
- if the service is unknown or
can't be initialized.protected Service getServiceInstance(java.lang.String name) throws InstantiationException
name
- The name of the service requested.InstantiationException,
- if the service is unknown or
can't be initialized.public java.util.Properties getProperties(java.lang.String name)
getProperties
in interface ServiceBroker
name
- The name of the service.public org.apache.stratum.configuration.Configuration getConfiguration(java.lang.String name)
getConfiguration
in interface ServiceBroker
name
- The name of the service.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |