Keel 2.1RC2

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

java.lang.Object
  extended byorg.apache.avalon.framework.logger.AbstractLogEnabled
      extended byorg.apache.excalibur.instrument.AbstractLogEnabledInstrumentable
          extended byorg.apache.avalon.fortress.impl.handler.AbstractComponentHandler
              extended byorg.apache.avalon.fortress.impl.handler.PoolableComponentHandler
All Implemented Interfaces:
ComponentHandler, Configurable, Disposable, Initializable, Instrumentable, LogEnabled, Serviceable

public final class PoolableComponentHandler
extends AbstractComponentHandler
implements Configurable

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

Since:
4.0
Version:
CVS $Revision: 1.10 $ $Date: 2004/02/28 15:16:25 $
Author:

Field Summary
private  Pool m_pool
          The pool of components for Poolable Components
private  PoolManager m_poolManager
          The instance of the PoolManager to create the Pool for the Handler
private  int m_poolMin
          The Config element for the poolable
 
Fields inherited from class org.apache.avalon.fortress.impl.handler.AbstractComponentHandler
m_disposed, m_factory, m_logger, m_loggerManager, m_prepared
 
Fields inherited from class org.apache.excalibur.instrument.AbstractLogEnabledInstrumentable
 
Fields inherited from interface org.apache.excalibur.instrument.Instrumentable
EMPTY_INSTRUMENT_ARRAY, EMPTY_INSTRUMENTABLE_ARRAY
 
Constructor Summary
PoolableComponentHandler()
           
 
Method Summary
 void configure(Configuration configuration)
          Configuration of the handler under which the minimum pool size is established.
protected  java.lang.Object doGet()
          Get a reference of the desired Component
protected  void doPrepare()
          Initialize the ComponentHandler.
protected  void doPut(java.lang.Object component)
          Return a reference of the desired Component
 void service(ServiceManager serviceManager)
          Application of suporting services to the handler.
 
Methods inherited from class org.apache.avalon.fortress.impl.handler.AbstractComponentHandler
dispose, disposeComponent, doDispose, get, getComponentClass, initialize, newComponent, prepareHandler, put, 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_poolManager

private PoolManager m_poolManager
The instance of the PoolManager to create the Pool for the Handler


m_pool

private Pool m_pool
The pool of components for Poolable Components


m_poolMin

private int m_poolMin
The Config element for the poolable

Constructor Detail

PoolableComponentHandler

public PoolableComponentHandler()
Method Detail

service

public void service(ServiceManager serviceManager)
             throws ServiceException
Application of suporting services to the handler.

Specified by:
service in interface Serviceable
Overrides:
service in class AbstractComponentHandler
Parameters:
serviceManager - the service manager
Throws:
ServiceException - if a service related error occurs

configure

public void configure(Configuration configuration)
               throws ConfigurationException
Configuration of the handler under which the minimum pool size is established.

Specified by:
configure in interface Configurable
Parameters:
configuration - the configuration fragment
Throws:
ConfigurationException - if the supplied configuration attribute for 'pool-min' cannot be resolved to an integer value

doPrepare

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

Overrides:
doPrepare in class AbstractComponentHandler
Throws:
java.lang.Exception - if an error occurs

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 an error occurs

doPut

protected void doPut(java.lang.Object component)
Return a reference of the desired Component

Overrides:
doPut in class AbstractComponentHandler
Parameters:
component - the component to return to the handler

Keel 2.1RC2

Please see keelframework.org for information about new Keel releases.