org.apache.avalon.excalibur.component
Class ComponentHandler

java.lang.Object
  extended byorg.apache.avalon.framework.logger.AbstractLogEnabled
      extended byorg.apache.avalon.excalibur.component.AbstractDualLogEnabled
          extended byorg.apache.avalon.excalibur.component.AbstractDualLogEnabledInstrumentable
              extended byorg.apache.avalon.excalibur.component.ComponentHandler
All Implemented Interfaces:
Disposable, Initializable, Instrumentable, LogEnabled, Loggable
Direct Known Subclasses:
DefaultComponentHandler, PoolableComponentHandler, ThreadSafeComponentHandler

Deprecated. ECM is no longer supported

public abstract class ComponentHandler
extends AbstractDualLogEnabledInstrumentable
implements Initializable, Disposable

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

Since:
4.0
Version:
CVS $Revision: 1.6 $ $Date: 2004/02/28 11:47:14 $
Author:
Avalon Development Team

Field Summary
 
Fields inherited from interface org.apache.excalibur.instrument.Instrumentable
EMPTY_INSTRUMENT_ARRAY, EMPTY_INSTRUMENTABLE_ARRAY
 
Constructor Summary
ComponentHandler()
          Deprecated. Creates a new ComponentHandler.
 
Method Summary
 boolean canBeDisposed()
          Deprecated. Returns true if this component handler can safely be disposed (i.e.
protected  Component doGet()
          Deprecated. Concrete implementation of getting a component.
protected  void doPut(Component component)
          Deprecated. Concrete implementation of putting back a component.
 Component get()
          Deprecated. Get an instance of the type of component handled by this handler.
static ComponentHandler getComponentHandler(java.lang.Class componentClass, Configuration configuration, ComponentManager componentManager, Context context, RoleManager roleManager, LogkitLoggerManager loggerManager)
          Deprecated. This method has been deprecated in favor of the version below which handles instrumentation.
static ComponentHandler getComponentHandler(java.lang.Class componentClass, Configuration configuration, ComponentManager componentManager, Context context, RoleManager roleManager, LogkitLoggerManager loggerManager, InstrumentManager instrumentManager, java.lang.String instrumentableName)
          Deprecated. Looks up and returns a component handler for a given component class.
static ComponentHandler getComponentHandler(Component componentInstance)
          Deprecated.  
static ComponentHandler getComponentHandler(java.lang.String role, java.lang.Class componentClass, Configuration configuration, ComponentManager componentManager, Context context, RoleManager roleManager, LogkitLoggerManager loggerManager)
          Deprecated. This method has been deprecated in favor of the version below which handles instrumentation.
static ComponentHandler getComponentHandler(java.lang.String role, java.lang.Class componentClass, Configuration configuration, ComponentManager componentManager, Context context, RoleManager roleManager, LogkitLoggerManager loggerManager, InstrumentManager instrumentManager, java.lang.String instrumentableName)
          Deprecated. Looks up and returns a component handler for a given component class.
 void put(Component component)
          Deprecated. Put back an instance of the type of component handled by this handler.
 
Methods inherited from class org.apache.avalon.excalibur.component.AbstractDualLogEnabledInstrumentable
addChildInstrumentable, addInstrument, getChildInstrumentables, getInstrumentableName, getInstruments, setInstrumentableName
 
Methods inherited from class org.apache.avalon.excalibur.component.AbstractDualLogEnabled
getLogkitLogger, setLogger
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.avalon.framework.activity.Initializable
initialize
 
Methods inherited from interface org.apache.avalon.framework.activity.Disposable
dispose
 

Constructor Detail

ComponentHandler

public ComponentHandler()
Deprecated. 
Creates a new ComponentHandler.

Method Detail

getComponentHandler

public static ComponentHandler getComponentHandler(java.lang.Class componentClass,
                                                   Configuration configuration,
                                                   ComponentManager componentManager,
                                                   Context context,
                                                   RoleManager roleManager,
                                                   LogkitLoggerManager loggerManager)
                                            throws java.lang.Exception
Deprecated. This method has been deprecated in favor of the version below which handles instrumentation.

Looks up and returns a component handler for a given component class. The componentClass must either implement Component or have a public static field named ROLE containing the Fully Qualified Classname as a String of the interface or class defining the component's role.

Parameters:
componentClass - Class of the component for which the handle is being requested.
configuration - The configuration for this component.
componentManager - The ComponentLocator which will be managing the Component.
context - The current context object.
roleManager - The current RoleManager.
loggerManager - The current LogKitLoggerManager.
Throws:
java.lang.Exception - If there were any problems obtaining a ComponentHandler

getComponentHandler

public static ComponentHandler getComponentHandler(java.lang.Class componentClass,
                                                   Configuration configuration,
                                                   ComponentManager componentManager,
                                                   Context context,
                                                   RoleManager roleManager,
                                                   LogkitLoggerManager loggerManager,
                                                   InstrumentManager instrumentManager,
                                                   java.lang.String instrumentableName)
                                            throws java.lang.Exception
Deprecated. 
Looks up and returns a component handler for a given component class. The componentClass must either implement Component or have a public static field named ROLE containing the Fully Qualified Classname as a String of the interface or class defining the component's role.

Parameters:
componentClass - Class of the component for which the handle is being requested.
configuration - The configuration for this component.
componentManager - The ComponentLocator which will be managing the Component.
context - The current context object.
roleManager - The current RoleManager.
loggerManager - The current LogKitLoggerManager.
instrumentManager - The current InstrumentManager (May be null).
instrumentableName - The instrumentable name to assign to components created by the handler.
Throws:
java.lang.Exception - If there were any problems obtaining a ComponentHandler

getComponentHandler

public static ComponentHandler getComponentHandler(java.lang.String role,
                                                   java.lang.Class componentClass,
                                                   Configuration configuration,
                                                   ComponentManager componentManager,
                                                   Context context,
                                                   RoleManager roleManager,
                                                   LogkitLoggerManager loggerManager)
                                            throws java.lang.Exception
Deprecated. This method has been deprecated in favor of the version below which handles instrumentation.

Looks up and returns a component handler for a given component class.

Parameters:
role - The role name of the component. This must be a fully-qualified classname.
componentClass - Class of the component for which the handle is being requested.
configuration - The configuration for this component.
componentManager - The ComponentLocator which will be managing the Component.
context - The current context object.
roleManager - The current RoleManager.
loggerManager - The current LogKitLoggerManager.
Throws:
java.lang.Exception - If there were any problems obtaining a ComponentHandler

getComponentHandler

public static ComponentHandler getComponentHandler(java.lang.String role,
                                                   java.lang.Class componentClass,
                                                   Configuration configuration,
                                                   ComponentManager componentManager,
                                                   Context context,
                                                   RoleManager roleManager,
                                                   LogkitLoggerManager loggerManager,
                                                   InstrumentManager instrumentManager,
                                                   java.lang.String instrumentableName)
                                            throws java.lang.Exception
Deprecated. 
Looks up and returns a component handler for a given component class.

Parameters:
role - The role name of the component. This must be a fully-qualified classname
componentClass - Class of the component for which the handle is being requested.
configuration - The configuration for this component.
componentManager - The ComponentLocator which will be managing the Component.
context - The current context object.
roleManager - The current RoleManager.
loggerManager - The current LogKitLoggerManager.
instrumentManager - The current InstrumentManager (May be null).
instrumentableName - The instrumentable name to assign to components created by the handler.
Throws:
java.lang.Exception - If there were any problems obtaining a ComponentHandler

getComponentHandler

public static ComponentHandler getComponentHandler(Component componentInstance)
                                            throws java.lang.Exception
Deprecated. 
Throws:
java.lang.Exception

get

public Component get()
              throws java.lang.Exception
Deprecated. 
Get an instance of the type of component handled by this handler.

Subclasses should not extend this method but rather the doGet method below otherwise reference counts will not be supported.

This method is not final to make the class backwards compatible.

Returns:
a Component
Throws:
java.lang.Exception - if an error occurs

put

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

Subclasses should not extend this method but rather the doPut method below otherwise reference counts will not be supported.

This method is not final to make the class backwards compatible.

Parameters:
component - a Component
Throws:
java.lang.Exception - if an error occurs

doGet

protected Component doGet()
                   throws java.lang.Exception
Deprecated. 
Concrete implementation of getting a component.

Returns:
a Component value
Throws:
java.lang.Exception - if an error occurs

doPut

protected void doPut(Component component)
              throws java.lang.Exception
Deprecated. 
Concrete implementation of putting back a component.

Parameters:
component - a Component value
Throws:
java.lang.Exception - if an error occurs

canBeDisposed

public final boolean canBeDisposed()
Deprecated. 
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


Copyright © 1997-2005 The Apache Software Foundation. All Rights Reserved.