org.apache.cocoon.core.container.handler
Class PoolableComponentHandler

java.lang.Object
  extended byorg.apache.cocoon.core.container.handler.AbstractComponentHandler
      extended byorg.apache.cocoon.core.container.handler.AbstractFactoryHandler
          extended byorg.apache.cocoon.core.container.handler.NonThreadSafePoolableComponentHandler
              extended byorg.apache.cocoon.core.container.handler.PoolableComponentHandler
All Implemented Interfaces:
ComponentHandler

public class PoolableComponentHandler
extends NonThreadSafePoolableComponentHandler

This is an extension to the NonThreadSafePoolableComponentHandler that uses proxies to make the poolable components thread safe.

Since:
2.2
Version:
$Id: PoolableComponentHandler.java 312637 2005-10-10 13:00:42Z cziegeler $

Nested Class Summary
protected static class PoolableComponentHandler.ProxyHandler
           
 
Field Summary
protected  Class[] interfaces
          All the interfaces for the proxy
 
Fields inherited from class org.apache.cocoon.core.container.handler.NonThreadSafePoolableComponentHandler
DEFAULT_MAX_POOL_SIZE, semaphore
 
Fields inherited from class org.apache.cocoon.core.container.handler.AbstractFactoryHandler
factory
 
Fields inherited from class org.apache.cocoon.core.container.handler.AbstractComponentHandler
disposed, logger
 
Constructor Summary
PoolableComponentHandler(ComponentInfo info, Logger logger, ComponentFactory factory, Configuration config)
          Create a PoolableComponentHandler which manages a pool of Components created by the specified factory object.
 
Method Summary
protected  Object createProxy()
           
protected  Object doGet()
          Concrete implementation of getting a component.
protected  void doInitialize()
           
protected  void doPut(Object component)
          Concrete implementation of putting back a component.
 
Methods inherited from class org.apache.cocoon.core.container.handler.NonThreadSafePoolableComponentHandler
dispose, getFromPool, permanentlyRemovePoolable, putIntoPool
 
Methods inherited from class org.apache.cocoon.core.container.handler.AbstractFactoryHandler
decommission
 
Methods inherited from class org.apache.cocoon.core.container.handler.AbstractComponentHandler
canBeDisposed, get, getComponentHandler, getComponentHandler, getInfo, initialize, isSingleton, put
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

interfaces

protected final Class[] interfaces
All the interfaces for the proxy

Constructor Detail

PoolableComponentHandler

public PoolableComponentHandler(ComponentInfo info,
                                Logger logger,
                                ComponentFactory factory,
                                Configuration config)
                         throws Exception
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

doGet

protected Object doGet()
                throws Exception
Description copied from class: AbstractComponentHandler
Concrete implementation of getting a component.

Overrides:
doGet in class NonThreadSafePoolableComponentHandler
Throws:
Exception

doPut

protected void doPut(Object component)
              throws Exception
Description copied from class: AbstractComponentHandler
Concrete implementation of putting back a component.

Overrides:
doPut in class NonThreadSafePoolableComponentHandler
Throws:
Exception

doInitialize

protected void doInitialize()
Overrides:
doInitialize in class NonThreadSafePoolableComponentHandler

createProxy

protected Object createProxy()


Copyright ? 1999-2005 The Apache Software Foundation. All Rights Reserved.