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

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.SingleThreadedComponentHandler
All Implemented Interfaces:
ComponentHandler

public class SingleThreadedComponentHandler
extends AbstractFactoryHandler

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

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

Field Summary
 
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
SingleThreadedComponentHandler(ComponentInfo info, Logger logger, ComponentFactory factory)
          Create a SingleThreadedComponentHandler which manages a pool of Components created by the specified factory object.
 
Method Summary
protected  Object doGet()
          Get a reference of the desired Component
protected  void doInitialize()
           
protected  void doPut(Object component)
          Return a reference of the desired Component
 
Methods inherited from class org.apache.cocoon.core.container.handler.AbstractFactoryHandler
decommission
 
Methods inherited from class org.apache.cocoon.core.container.handler.AbstractComponentHandler
canBeDisposed, dispose, 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
 

Constructor Detail

SingleThreadedComponentHandler

public SingleThreadedComponentHandler(ComponentInfo info,
                                      Logger logger,
                                      ComponentFactory factory)
Create a SingleThreadedComponentHandler which manages a pool of Components created by the specified factory object.

Parameters:
logger - The logger to use
factory - The factory object which is responsible for creating the components managed by the handler.
Method Detail

doGet

protected Object doGet()
                throws Exception
Get a reference of the desired Component

Specified by:
doGet in class AbstractComponentHandler
Returns:
A component instance.
Throws:
Exception - If there are any problems encountered acquiring a component instance.

doPut

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

Specified by:
doPut in class AbstractComponentHandler
Parameters:
component - Component to be be put/released back to the handler.

doInitialize

protected void doInitialize()
Specified by:
doInitialize in class AbstractComponentHandler


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