org.apache.avalon.excalibur.component
Class ThreadSafeComponentHandler

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.avalon.excalibur.component.AbstractDualLogEnabled
          extended by org.apache.avalon.excalibur.component.AbstractDualLogEnabledInstrumentable
              extended by org.apache.avalon.excalibur.component.ComponentHandler
                  extended by org.apache.avalon.excalibur.component.ThreadSafeComponentHandler
All Implemented Interfaces:
org.apache.avalon.framework.activity.Disposable, org.apache.avalon.framework.activity.Initializable, org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.framework.logger.Loggable, org.apache.excalibur.instrument.Instrumentable

Deprecated. ECM is no longer supported

public class ThreadSafeComponentHandler
extends ComponentHandler

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

Since:
4.0
Version:
CVS $Revision: 1.4 $ $Date: 2004/02/28 11:47:14 $
Author:
Avalon Development Team

Field Summary
private  boolean m_disposed
          Deprecated.  
private  DefaultComponentFactory m_factory
          Deprecated.  
private  boolean m_initialized
          Deprecated.  
private  org.apache.avalon.framework.component.Component m_instance
          Deprecated.  
 
Fields inherited from interface org.apache.excalibur.instrument.Instrumentable
EMPTY_INSTRUMENT_ARRAY, EMPTY_INSTRUMENTABLE_ARRAY
 
Constructor Summary
protected ThreadSafeComponentHandler(org.apache.avalon.framework.component.Component component)
          Deprecated. Create a ComponentHandler that takes care of hiding the details of whether a Component is ThreadSafe, Poolable, or SingleThreaded.
  ThreadSafeComponentHandler(DefaultComponentFactory factory, org.apache.avalon.framework.configuration.Configuration config)
          Deprecated. Create a ThreadSafeComponentHandler which manages a pool of Components created by the specified factory object.
protected ThreadSafeComponentHandler(java.lang.String role, java.lang.Class componentClass, org.apache.avalon.framework.configuration.Configuration config, org.apache.avalon.framework.component.ComponentManager manager, org.apache.avalon.framework.context.Context context, RoleManager roles, LogkitLoggerManager logkit)
          Deprecated. Create a ComponentHandler that takes care of hiding the details of whether a Component is ThreadSafe, Poolable, or SingleThreaded.
 
Method Summary
 void dispose()
          Deprecated. Dispose of the ComponentHandler and any associated Pools and Factories.
protected  org.apache.avalon.framework.component.Component doGet()
          Deprecated. Get a reference of the desired Component
protected  void doPut(org.apache.avalon.framework.component.Component component)
          Deprecated. Return a reference of the desired Component
 void initialize()
          Deprecated. Initialize the ComponentHandler.
 
Methods inherited from class org.apache.avalon.excalibur.component.ComponentHandler
canBeDisposed, get, getComponentHandler, getComponentHandler, getComponentHandler, getComponentHandler, getComponentHandler, put
 
Methods inherited from class org.apache.avalon.excalibur.component.AbstractDualLogEnabledInstrumentable
addChildInstrumentable, addInstrument, getChildInstrumentables, getInstrumentableName, getInstruments, setInstrumentableName
 
Methods inherited from class org.apache.avalon.excalibur.component.AbstractDualLogEnabled
getLogkitLogger, setLogger
 
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, toString, wait, wait, wait
 

Field Detail

m_instance

private org.apache.avalon.framework.component.Component m_instance
Deprecated. 

m_factory

private final DefaultComponentFactory m_factory
Deprecated. 

m_initialized

private boolean m_initialized
Deprecated. 

m_disposed

private boolean m_disposed
Deprecated. 
Constructor Detail

ThreadSafeComponentHandler

protected ThreadSafeComponentHandler(java.lang.String role,
                                     java.lang.Class componentClass,
                                     org.apache.avalon.framework.configuration.Configuration config,
                                     org.apache.avalon.framework.component.ComponentManager manager,
                                     org.apache.avalon.framework.context.Context context,
                                     RoleManager roles,
                                     LogkitLoggerManager logkit)
                              throws java.lang.Exception
Deprecated. 
Create a ComponentHandler that takes care of hiding the details of whether a Component is ThreadSafe, Poolable, or SingleThreaded. It falls back to SingleThreaded if not specified.

Throws:
java.lang.Exception

ThreadSafeComponentHandler

public ThreadSafeComponentHandler(DefaultComponentFactory factory,
                                  org.apache.avalon.framework.configuration.Configuration config)
                           throws java.lang.Exception
Deprecated. 
Create a ThreadSafeComponentHandler which manages a pool of Components created by the specified factory object.

Parameters:
factory - The factory object which is responsible for creating the components managed by the ComponentHandler.
config - The configuration to use to configure the pool.
Throws:
java.lang.Exception

ThreadSafeComponentHandler

protected ThreadSafeComponentHandler(org.apache.avalon.framework.component.Component component)
                              throws java.lang.Exception
Deprecated. 
Create a ComponentHandler that takes care of hiding the details of whether a Component is ThreadSafe, Poolable, or SingleThreaded. It falls back to SingleThreaded if not specified.

Throws:
java.lang.Exception
Method Detail

initialize

public void initialize()
                throws java.lang.Exception
Deprecated. 
Initialize the ComponentHandler.

Throws:
java.lang.Exception

doGet

protected org.apache.avalon.framework.component.Component doGet()
                                                         throws java.lang.Exception
Deprecated. 
Get a reference of the desired Component

Overrides:
doGet in class ComponentHandler
Returns:
a Component value
Throws:
java.lang.Exception - if an error occurs

doPut

protected void doPut(org.apache.avalon.framework.component.Component component)
Deprecated. 
Return a reference of the desired Component

Overrides:
doPut in class ComponentHandler
Parameters:
component - a Component value

dispose

public void dispose()
Deprecated. 
Dispose of the ComponentHandler and any associated Pools and Factories.