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 for Service classes. Functionality that ServiceBroker provides in addition to InitableBroker functionality includes:

Version:
$Id: ServiceBroker.java 534527 2007-05-02 16:10:59Z tv $
Author:
Kevin Burton, Rafal Krzewski, Daniel Rall, Henning P. Schmiedehausen

Method Summary
 org.apache.commons.configuration.Configuration getConfiguration(java.lang.String name)
          Returns the configuration of a specific service.
 Service getService(java.lang.String name)
          Returns an instance of requested Service.
 void initService(java.lang.String name)
          Performs early initialization of the specified service.
 boolean isRegistered(java.lang.String serviceName)
          Determines whether a service is registered in the configured TurbineResources.properties.
 void shutdownService(java.lang.String name)
          Shutdowns a Service.
 void shutdownServices()
          Shutdowns all Services.
 

Method Detail

isRegistered

public boolean isRegistered(java.lang.String serviceName)
Determines whether a service is registered in the configured TurbineResources.properties.

Parameters:
serviceName - The name of the service whose existance to check.
Returns:
Registration predicate for the desired services.

initService

public void initService(java.lang.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

public void shutdownService(java.lang.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

public void shutdownServices()
Shutdowns all Services. This method is used to release resources allocated by Services, and return them to initial (uninitialized) state.


getService

public Service getService(java.lang.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

public org.apache.commons.configuration.Configuration getConfiguration(java.lang.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.


Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.