|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.turbine.services.BaseInitableBroker
A generic implementation of InitableBroker
.
Functionality provided by the broker includes:
Initable
in
the system.Initables
during system
startup.Initables
before they are
used.Initables
to requesting
parties.Initables
during
early initalization phases, including circular dependencies
detection.
Field Summary | |
protected java.util.Hashtable |
initables
A repository of Initable instances. |
protected java.util.Stack |
stack
Names of classes being early-initialized are pushed onto this stack. |
Constructor Summary | |
protected |
BaseInitableBroker()
Default constructor of InitableBorker. |
Method Summary | |
void |
error(java.lang.Throwable t)
Output an error message. |
Initable |
getInitable(java.lang.String className)
Provides an instance of Initable class ready to work. |
protected Initable |
getInitableInstance(java.lang.String className)
Retrieves an instance of an Initable from the repository. |
void |
initClass(java.lang.String className,
java.lang.Object data)
Performs early initialization of an Initable class. |
void |
notice(java.lang.String msg)
Output a diagnostic notice. |
void |
shutdownClass(java.lang.String className)
Shuts down an Initable . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.util.Hashtable initables
protected java.util.Stack stack
Constructor Detail |
protected BaseInitableBroker()
Method Detail |
public void initClass(java.lang.String className, java.lang.Object data) throws InitializationException
initClass
in interface InitableBroker
className
- The name of the class to be initailized.data
- An Object to be used for initialization activities.InitializationException
- Initialization was not successful.public void shutdownClass(java.lang.String className)
Initable
.
This method is used to release resources allocated by an
Initable
, and return it to its initial (uninitailized)
state.shutdownClass
in interface InitableBroker
className
- The name of the class to be uninitialized.public Initable getInitable(java.lang.String className) throws InstantiationException
getInitable
in interface InitableBroker
className
- The name of the Initable requested.InstantiationException,
- if there was a problem
during instantiation or initialization of the Initable.protected Initable getInitableInstance(java.lang.String className) throws InstantiationException
className
- The name of the class to be instantiated.InstantiationException,
- if the requested class can't
be instantiated.public void notice(java.lang.String msg)
The default implementation uses system error stream. When writing your own, remeber to direct that message to the proper logging mechanism.
msg
- the message to print.public void error(java.lang.Throwable t)
The default implementation uses system error stream. When writing your own, remeber to direct that message to the proper logging mechanism.
msg
- the message to print.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |