Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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:

- Maintaining a single instance of each `Initable` in the system.
- Early initialization of `Initables` during system startup.
- Late initialization of `Initables` before they are used.
- Providing instances of `Initables` to requesting parties.
- Maintainging dependencies between `Initables` during early initalization phases, including circular dependencies detection.

Version:
  $Id: InitableBroker.java 615328 2008-01-25 20:25:05Z tv $
Author:
  Kevin Burton, Rafal Krzewski

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

Method Detail

### initClass

    void initClass(String className,
                   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

    void shutdownClass(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

    Initable getInitable(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.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000-2011 The Apache Software Foundation. All Rights Reserved.