org.apache.cocoon.core.container.handler
Interface ComponentHandler

All Known Implementing Classes:
AbstractComponentHandler, LazyHandler

public interface ComponentHandler

This class acts like a Factory to instantiate the correct version of the component handler that you need.

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

Method Summary
 boolean canBeDisposed()
          Returns true if this component handler can safely be disposed (i.e. none of the components it is handling are still being used).
 void dispose()
          Dispose of the component handler and any associated Pools and Factories.
 Object get()
          Get an instance of the type of component handled by this handler.
 ComponentInfo getInfo()
          Get the service metadata for this handler
 void initialize()
          Initialize this handler
 boolean isSingleton()
          Indicates if this handler manages a single object, i.e. all calls to get() will return the same object.
 void put(Object component)
          Put back an instance of the type of component handled by this handler.
 

Method Detail

get

public Object get()
           throws Exception
Get an instance of the type of component handled by this handler.

Returns:
an instance
Throws:
Exception - if an error occurs

put

public void put(Object component)
         throws Exception
Put back an instance of the type of component handled by this handler.

Parameters:
component - a service
Throws:
Exception - if an error occurs

isSingleton

public boolean isSingleton()
Indicates if this handler manages a single object, i.e. all calls to get() will return the same object.

Returns:
true if managed object is a singleton

canBeDisposed

public boolean canBeDisposed()
Returns true if this component handler can safely be disposed (i.e. none of the components it is handling are still being used).

Returns:
true if this component handler can safely be disposed; false otherwise

dispose

public void dispose()
Dispose of the component handler and any associated Pools and Factories.


initialize

public void initialize()
                throws Exception
Initialize this handler

Throws:
Exception

getInfo

public ComponentInfo getInfo()
Get the service metadata for this handler



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