org.apache.turbine.services
Interface ServiceBroker

All Superinterfaces:
InitableBroker
All Known Implementing Classes:
BaseServiceBroker

public interface ServiceBroker
extends InitableBroker

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$
Author:
Kevin Burton, Rafal Krzewski, Daniel Rall

Method Summary
 org.apache.velocity.runtime.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.
 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.
 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.
 
Methods inherited from interface org.apache.turbine.services.InitableBroker
getInitable, initClass, shutdownClass
 

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,
                        java.lang.Object data)
                 throws InitializationException
Performs early initialization of specified service.
Parameters:
name - The name of the service.
data - An Object to use for initialization activities.
Throws:
InitializationException, - if the service is unknown or can't be initialized.

initServices

public void initServices(java.lang.Object data)
Performs early initialization of all services.
Parameters:
data - An Object to use for initialization activities.

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 (uninitailized) 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.

getProperties

public java.util.Properties getProperties(java.lang.String name)
Returns the properites of a specific service. Services use this method to retrieve their properties.
Parameters:
name - The name of the service.
Returns:
Properties of requested Service.

getConfiguration

public org.apache.velocity.runtime.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 © 1999-2001 Apache Software Foundation. All Rights Reserved.