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

java.lang.Object
  extended by org.apache.avalon.fortress.impl.handler.LEAwareComponentHandler
All Implemented Interfaces:
ComponentHandler, org.apache.avalon.framework.activity.Disposable

public final class LEAwareComponentHandler
extends java.lang.Object
implements ComponentHandler, org.apache.avalon.framework.activity.Disposable

A ComponentHandler that delegates to underlying handler but also calls relevent Lifecycle Extension handlers at the right time.

Version:
CVS $Revision: 1.18 $ $Date: 2004/02/28 15:16:25 $
Author:
Avalon Development Team

Field Summary
private  ComponentHandler m_componentHandler
           
private  org.apache.avalon.framework.context.Context m_context
           
private  LifecycleExtensionManager m_extManager
           
 
Constructor Summary
LEAwareComponentHandler(ComponentHandler componentHandler, LifecycleExtensionManager extManager, org.apache.avalon.framework.context.Context context)
          Creation of a new handler.
 
Method Summary
 void dispose()
          Disposal of the handler.
 java.lang.Object get()
          Retrieve the object and execute access extensions.
 java.lang.Class getComponentClass()
          Return the component's class that this handler is trying to create.
 void prepareHandler()
          Prepare the handler.
 void put(java.lang.Object component)
          Return component and execute Release extensions.
 java.lang.String toString()
          Human readable string message
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_componentHandler

private final ComponentHandler m_componentHandler

m_extManager

private final LifecycleExtensionManager m_extManager

m_context

private final org.apache.avalon.framework.context.Context m_context
Constructor Detail

LEAwareComponentHandler

public LEAwareComponentHandler(ComponentHandler componentHandler,
                               LifecycleExtensionManager extManager,
                               org.apache.avalon.framework.context.Context context)
Creation of a new handler.

Parameters:
componentHandler - the handler
extManager - the extension manager
context - the context
Method Detail

getComponentClass

public java.lang.Class getComponentClass()
Return the component's class that this handler is trying to create. Used for deubug information.

Specified by:
getComponentClass in interface ComponentHandler
Returns:
the Class object for the component

prepareHandler

public void prepareHandler()
                    throws java.lang.Exception
Prepare the handler.

Specified by:
prepareHandler in interface ComponentHandler
Throws:
java.lang.Exception - if a handler preparation error occurs

get

public java.lang.Object get()
                     throws java.lang.Exception
Retrieve the object and execute access extensions.

Specified by:
get in interface ComponentHandler
Returns:
the object
Throws:
java.lang.Exception - if unable to aquire object

put

public void put(java.lang.Object component)
Return component and execute Release extensions.

Specified by:
put in interface ComponentHandler
Parameters:
component - the component

dispose

public void dispose()
Disposal of the handler.

Specified by:
dispose in interface org.apache.avalon.framework.activity.Disposable

toString

public java.lang.String toString()
Human readable string message

Overrides:
toString in class java.lang.Object