Package org.apache.turbine.services
Interface InitableBroker
-
- All Known Implementing Classes:
BaseInitableBroker
public interface InitableBroker
Classes that implement this interface can act as a broker forInitable
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. - Maintaining dependencies between
Initables
during early initialization phases, including circular dependencies detection.
- Version:
- $Id$
- Author:
- Kevin Burton, Rafal Krzewski
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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 initialized.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 (uninitialized) 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.
-
-