Package org.apache.turbine.services
Interface ServiceBroker
-
- All Known Subinterfaces:
ServiceManager
- All Known Implementing Classes:
BaseServiceBroker,TurbineServices
public interface ServiceBroker
Classes that implement this interface can act as a broker forServiceclasses. Functionality thatServiceBrokerprovides in addition toInitableBrokerfunctionality includes:- Maintaining service name to class name mapping, allowing plugable service implementations.
- Providing
ServiceswithPropertiesbased on a system wide configuration mechanism.
- Version:
- $Id$
- Author:
- Kevin Burton, Rafal Krzewski, Daniel Rall, Henning P. Schmiedehausen
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringgetApplicationRoot()Get the application root as set by the parent application.org.apache.commons.configuration2.ConfigurationgetConfiguration(String name)Returns the configuration of a specific service.ObjectgetService(String name)Returns an instance of requested Service.voidinitService(String name)Performs early initialization of the specified service.booleanisRegistered(String serviceName)Determines whether a service is registered in the configuredTurbineResources.properties.voidshutdownService(String name)Shutdowns a Service.voidshutdownServices()Shutdowns all Services.
-
-
-
Method Detail
-
isRegistered
boolean isRegistered(String serviceName)
Determines whether a service is registered in the configuredTurbineResources.properties.- Parameters:
serviceName- The name of the service whose existance to check.- Returns:
- Registration predicate for the desired services.
-
initService
void initService(String name) throws InitializationException
Performs early initialization of the specified service.- Parameters:
name- The name of the service.- Throws:
InitializationException- if the service is unknown or can't be initialized.
-
shutdownService
void shutdownService(String name)
Shutdowns a Service. This method is used to release resources allocated by a Service, and return it to initial (uninitailized) state.- Parameters:
name- The name of the Service to be uninitialized.
-
shutdownServices
void shutdownServices()
Shutdowns all Services. This method is used to release resources allocated by Services, and return them to initial (uninitialized) state.
-
getService
Object getService(String name) throws InstantiationException
Returns an instance of requested Service.- Parameters:
name- The name of the Service requested.- Returns:
- An instance of requested Service.
- Throws:
InstantiationException- if the service is unknown or can't be initialized.
-
getConfiguration
org.apache.commons.configuration2.Configuration getConfiguration(String name)
Returns the configuration of a specific service. Services use this method to retrieve their configuration.- Parameters:
name- The name of the service.- Returns:
- Configuration of the requested service.
-
getApplicationRoot
String getApplicationRoot()
Get the application root as set by the parent application.- Returns:
- String application root
-
-