org.apache.avalon.fortress.impl.handler
Class ThreadSafeComponentHandler

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.excalibur.instrument.AbstractLogEnabledInstrumentable
          extended by org.apache.avalon.fortress.impl.handler.AbstractComponentHandler
              extended by org.apache.avalon.fortress.impl.handler.ThreadSafeComponentHandler
All Implemented Interfaces:
ComponentHandler, org.apache.avalon.framework.activity.Disposable, org.apache.avalon.framework.activity.Initializable, org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.framework.service.Serviceable, org.apache.excalibur.instrument.Instrumentable

public final class ThreadSafeComponentHandler
extends AbstractComponentHandler

The ThreadSafeComponentHandler to make sure components are initialized and destroyed correctly.

Since:
4.0
Version:
CVS $Revision: 1.7 $ $Date: 2004/02/28 15:16:25 $
Author:
Avalon Development Team

Field Summary
private  java.lang.Object m_instance
           
 
Fields inherited from class org.apache.avalon.fortress.impl.handler.AbstractComponentHandler
m_disposed, m_factory, m_logger, m_loggerManager, m_prepared
 
Fields inherited from interface org.apache.excalibur.instrument.Instrumentable
EMPTY_INSTRUMENT_ARRAY, EMPTY_INSTRUMENTABLE_ARRAY
 
Constructor Summary
ThreadSafeComponentHandler()
           
 
Method Summary
protected  void doDispose()
          Dispose of the ComponentHandler and any associated Pools and Factories.
protected  java.lang.Object doGet()
          Return instance for a get.
protected  void doPrepare()
          Initialize the ComponentHandler.
 
Methods inherited from class org.apache.avalon.fortress.impl.handler.AbstractComponentHandler
dispose, disposeComponent, doPut, get, getComponentClass, initialize, newComponent, prepareHandler, put, service, toString
 
Methods inherited from class org.apache.excalibur.instrument.AbstractLogEnabledInstrumentable
addChildInstrumentable, addInstrument, getChildInstrumentables, getInstrumentableName, getInstruments, setInstrumentableName
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_instance

private java.lang.Object m_instance
Constructor Detail

ThreadSafeComponentHandler

public ThreadSafeComponentHandler()
Method Detail

doPrepare

protected void doPrepare()
                  throws java.lang.Exception
Initialize the ComponentHandler.

Overrides:
doPrepare in class AbstractComponentHandler
Throws:
java.lang.Exception - if a handler preparation error occurs

doGet

protected java.lang.Object doGet()
                          throws java.lang.Exception
Return instance for a get.

Specified by:
doGet in class AbstractComponentHandler
Returns:
the instance
Throws:
java.lang.Exception - if a handler access error occurs

doDispose

protected void doDispose()
Dispose of the ComponentHandler and any associated Pools and Factories.

Overrides:
doDispose in class AbstractComponentHandler