org.apache.avalon.excalibur.component
Class PoolableComponentHandler

java.lang.Object
  extended byorg.apache.avalon.framework.logger.AbstractLogEnabled
      extended byorg.apache.avalon.excalibur.component.AbstractDualLogEnabled
          extended byorg.apache.avalon.excalibur.component.AbstractDualLogEnabledInstrumentable
              extended byorg.apache.avalon.excalibur.component.ComponentHandler
                  extended byorg.apache.avalon.excalibur.component.PoolableComponentHandler
All Implemented Interfaces:
Disposable, Initializable, Instrumentable, LogEnabled, Loggable

Deprecated. ECM is no longer supported

public class PoolableComponentHandler
extends ComponentHandler

The PoolableComponentHandler to make sure that poolable components are initialized destroyed and pooled correctly.

Components which implement Poolable may be configured to be pooled using the following example configuration. This example assumes that the user component class MyComp implements Poolable.

Configuration Example:

   <my-comp pool-max="8" pool-max-strict="false" pool-blocking="true" pool-timeout="0"
            pool-trim-interval="0"/>
 

Roles Example:

   <role name="com.mypkg.MyComponent"
         shorthand="my-comp"
         default-class="com.mypkg.DefaultMyComponent"/>
 

Configuration Attributes:

Since:
4.0
Version:
CVS $Revision: 1.5 $ $Date: 2004/03/30 14:15:23 $
Author:
Avalon Development Team

Field Summary
static int DEFAULT_MAX_POOL_SIZE
          Deprecated. The default max size of the pool
 
Fields inherited from interface org.apache.excalibur.instrument.Instrumentable
EMPTY_INSTRUMENT_ARRAY, EMPTY_INSTRUMENTABLE_ARRAY
 
Constructor Summary
  PoolableComponentHandler(DefaultComponentFactory factory, Configuration config)
          Deprecated. Create a PoolableComponentHandler which manages a pool of Components created by the specified factory object.
protected PoolableComponentHandler(java.lang.String role, java.lang.Class componentClass, Configuration config, ComponentManager manager, 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  Component doGet()
          Deprecated. Get a reference of the desired Component
protected  void doPut(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

DEFAULT_MAX_POOL_SIZE

public static final int DEFAULT_MAX_POOL_SIZE
Deprecated. 
The default max size of the pool

See Also:
Constant Field Values
Constructor Detail

PoolableComponentHandler

protected PoolableComponentHandler(java.lang.String role,
                                   java.lang.Class componentClass,
                                   Configuration config,
                                   ComponentManager manager,
                                   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.


PoolableComponentHandler

public PoolableComponentHandler(DefaultComponentFactory factory,
                                Configuration config)
                         throws java.lang.Exception
Deprecated. 
Create a PoolableComponentHandler 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.
Method Detail

initialize

public void initialize()
Deprecated. 
Initialize the ComponentHandler.


doGet

protected 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(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.



Copyright © 1997-2005 The Apache Software Foundation. All Rights Reserved.