org.apache.turbine.services
Interface InitableBroker

All Known Implementing Classes:
BaseInitableBroker

public interface InitableBroker

Classes that implement this interface can act as a broker for Initable classes. Functionality provided by the broker includes:

Version:
$Id: InitableBroker.java 534527 2007-05-02 16:10:59Z tv $
Author:
Kevin Burton, Rafal Krzewski

Method Summary
 Initable getInitable(java.lang.String className)
          Provides an instance of Initable class ready to work.
 void initClass(java.lang.String className, java.lang.Object data)
          Performs early initialization of an Initable class.
 void shutdownClass(java.lang.String className)
          Shutdowns an Initable class.
 

Method Detail

initClass

public void initClass(java.lang.String className,
                      java.lang.Object data)
               throws InitializationException
Performs early initialization of an Initable class. If your class depends on another Initable being initialized to perform early initialization, you should always ask your broker to initialize the other class with the objects that are passed to you, before you try to retrieve that Initable's instance with getInitable().

Parameters:
className - The name of the class to be initailized.
data - An object to be used for initialization activities.
Throws:
InitializationException - if initialization of this class was not successful.

shutdownClass

public void shutdownClass(java.lang.String className)
Shutdowns an Initable class. This method is used to release resources allocated by an Initable class, and return it to initial (uninitailized) state.

Parameters:
className - The name of the class to be uninitialized.

getInitable

public Initable getInitable(java.lang.String className)
                     throws InstantiationException
Provides an instance of Initable class ready to work. If the requested class couldn't be instatiated or initialized, InstantiationException will be thrown. You needn't handle this exception in your code, since it indicates fatal misconfigurtion of the system.

Parameters:
className - The name of the Initable requested.
Returns:
An instance of requested Initable.
Throws:
InstantiationException - if there was a problem during instantiation or initialization of the Initable.


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