org.apache.avalon.fortress.impl.handler
Class PerThreadComponentHandler
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.excalibur.instrument.AbstractLogEnabledInstrumentable
org.apache.avalon.fortress.impl.handler.AbstractComponentHandler
org.apache.avalon.fortress.impl.handler.PerThreadComponentHandler
- All Implemented Interfaces:
- ComponentHandler, Disposable, Initializable, Instrumentable, LogEnabled, Serviceable
- public final class PerThreadComponentHandler
- extends AbstractComponentHandler
The ThreadSafeComponentHandler to make sure components are initialized and destroyed correctly.
- Since:
- 4.0
- Version:
- CVS $Revision: 1.9 $ $Date: 2004/02/28 15:16:25 $
- Author:
| Method Summary |
protected void |
doDispose()
Dispose handler specific resources. |
protected java.lang.Object |
doGet()
Get a reference of the desired Component |
void |
initialize()
Initialize the component. |
| Methods inherited from class org.apache.avalon.fortress.impl.handler.AbstractComponentHandler |
dispose, disposeComponent, doPrepare, doPut, get, getComponentClass, newComponent, prepareHandler, put, service, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
m_instance
private PerThreadComponentHandler.ThreadLocalComponent m_instance
-
m_instances
private java.util.List m_instances
-
PerThreadComponentHandler
public PerThreadComponentHandler()
initialize
public void initialize()
throws java.lang.Exception
- Description copied from interface:
Initializable
-
Initialize the component. Initialization includes allocating any resources required throughout the component's lifecycle.
-
- Specified by:
initialize in interface Initializable
- Overrides:
initialize in class AbstractComponentHandler
-
- Throws:
java.lang.Exception
doGet
protected java.lang.Object doGet()
throws java.lang.Exception
-
Get a reference of the desired Component
-
- Specified by:
doGet in class AbstractComponentHandler
-
- Returns:
- the service
- Throws:
java.lang.Exception - if unable to aquire service
doDispose
protected void doDispose()
- Description copied from class:
AbstractComponentHandler
-
Dispose handler specific resources. Subclasses should overide this to provide their own funcitonality.
-
- Overrides:
doDispose in class AbstractComponentHandler
-
Please see keelframework.org for information about new Keel releases.