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

java.lang.Object
  extended byorg.apache.cocoon.core.container.handler.LazyHandler
All Implemented Interfaces:
ComponentHandler

public class LazyHandler
extends Object
implements ComponentHandler

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

Constructor Summary
LazyHandler(String role, String className, Configuration configuration, ComponentEnvironment environment)
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LazyHandler

public LazyHandler(String role,
                   String className,
                   Configuration configuration,
                   ComponentEnvironment environment)
Method Detail

get

public Object get()
           throws Exception
Description copied from interface: ComponentHandler
Get an instance of the type of component handled by this handler.

Specified by:
get in interface ComponentHandler
Returns:
an instance
Throws:
Exception - if an error occurs

put

public void put(Object component)
         throws Exception
Description copied from interface: ComponentHandler
Put back an instance of the type of component handled by this handler.

Specified by:
put in interface ComponentHandler
Parameters:
component - a service
Throws:
Exception - if an error occurs

isSingleton

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

Specified by:
isSingleton in interface ComponentHandler
Returns:
true if managed object is a singleton

canBeDisposed

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

Specified by:
canBeDisposed in interface ComponentHandler
Returns:
true if this component handler can safely be disposed; false otherwise

dispose

public void dispose()
Description copied from interface: ComponentHandler
Dispose of the component handler and any associated Pools and Factories.

Specified by:
dispose in interface ComponentHandler

initialize

public void initialize()
                throws Exception
Description copied from interface: ComponentHandler
Initialize this handler

Specified by:
initialize in interface ComponentHandler
Throws:
Exception

getInfo

public ComponentInfo getInfo()
Description copied from interface: ComponentHandler
Get the service metadata for this handler

Specified by:
getInfo in interface ComponentHandler


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