org.apache.turbine.services
Interface InitableBroker
- All Known Subinterfaces:
- ServiceBroker
- 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,v 1.1.1.1 2001/08/16 05:08:46 jvanzyl Exp $
- 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. |
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-2002 Apache Software Foundation. All Rights Reserved.