org.apache.avalon.excalibur.component
Class ExcaliburComponentManager

java.lang.Object
  extended byorg.apache.avalon.framework.logger.AbstractLogEnabled
      extended byorg.apache.avalon.excalibur.component.AbstractDualLogEnabled
          extended byorg.apache.avalon.excalibur.component.ExcaliburComponentManager
All Implemented Interfaces:
ComponentManager, Configurable, Contextualizable, Disposable, Initializable, Instrumentable, InstrumentManageable, LogEnabled, Loggable, LoggerManageable, LogKitManageable, RoleManageable
Direct Known Subclasses:
DefaultComponentManager

Deprecated. ECM is no longer supported

public class ExcaliburComponentManager
extends AbstractDualLogEnabled
implements ComponentManager, Configurable, Contextualizable, Initializable, Disposable, RoleManageable, LogKitManageable, LoggerManageable, InstrumentManageable, Instrumentable

Default component manager for Avalon's components.

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

Field Summary
static java.lang.String INSTRUMENTABLE_NAME
          Deprecated. Instrumentable name used to represent the component-manager.
 
Fields inherited from interface org.apache.excalibur.instrument.Instrumentable
EMPTY_INSTRUMENT_ARRAY, EMPTY_INSTRUMENTABLE_ARRAY
 
Constructor Summary
ExcaliburComponentManager()
          Deprecated. Create a new ExcaliburComponentManager.
ExcaliburComponentManager(java.lang.ClassLoader loader)
          Deprecated. Create a new ExcaliburComponentManager with uses a specific Classloader.
ExcaliburComponentManager(ComponentManager manager)
          Deprecated. Create the ComponentLocator with a parent ComponentLocator
ExcaliburComponentManager(ComponentManager manager, java.lang.ClassLoader loader)
          Deprecated. Create the ComponentLocator with a Classloader and parent ComponentLocator
 
Method Summary
 void addComponent(java.lang.String role, java.lang.Class component, Configuration configuration)
          Deprecated. Add a new component to the manager.
 void addComponentInstance(java.lang.String role, Component instance)
          Deprecated. Add a static instance of a component to the manager.
 void configure(Configuration configuration)
          Deprecated. Configure the ComponentLocator.
 void contextualize(Context context)
          Deprecated. Set up the Component's Context.
 void dispose()
          Deprecated. Properly dispose of the Child handlers.
 Instrumentable[] getChildInstrumentables()
          Deprecated. Any Object which implements Instrumentable can also make use of other Instrumentable child objects.
protected  ComponentHandler getComponentHandler(java.lang.String role, java.lang.Class componentClass, Configuration configuration, Context context, RoleManager roleManager, LogkitLoggerManager logkitManager)
          Deprecated. Obtain a new ComponentHandler for the specified component.
 java.lang.String getInstrumentableName()
          Deprecated. Gets the name of the Instrumentable.
 Instrument[] getInstruments()
          Deprecated. Obtain a reference to all the Instruments that the Instrumentable object wishes to expose.
 boolean hasComponent(java.lang.String role)
          Deprecated. Tests for existence of a component.
 void initialize()
          Deprecated. Properly initialize of the Child handlers.
 Component lookup(java.lang.String role)
          Deprecated. Return an instance of a component based on a Role.
 void release(Component component)
          Deprecated. Release a Component.
 void setInstrumentableName(java.lang.String name)
          Deprecated. Sets the name for the Instrumentable.
 void setInstrumentManager(InstrumentManager instrumentManager)
          Deprecated. Sets the InstrumentManager for child components.
 void setLoggerManager(LoggerManager logkit)
          Deprecated. Configure the LoggerManager.
 void setLogKitManager(LogKitManager logkit)
          Deprecated. Configure the LogKitManager
 void setRoleManager(RoleManager roles)
          Deprecated. Configure the RoleManager
 
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
 

Field Detail

INSTRUMENTABLE_NAME

public static final java.lang.String INSTRUMENTABLE_NAME
Deprecated. 
Instrumentable name used to represent the component-manager. Handlers reference this name to register themselves at the correct location under the ECM.

See Also:
Constant Field Values
Constructor Detail

ExcaliburComponentManager

public ExcaliburComponentManager()
Deprecated. 
Create a new ExcaliburComponentManager.


ExcaliburComponentManager

public ExcaliburComponentManager(java.lang.ClassLoader loader)
Deprecated. 
Create a new ExcaliburComponentManager with uses a specific Classloader.


ExcaliburComponentManager

public ExcaliburComponentManager(ComponentManager manager,
                                 java.lang.ClassLoader loader)
Deprecated. 
Create the ComponentLocator with a Classloader and parent ComponentLocator


ExcaliburComponentManager

public ExcaliburComponentManager(ComponentManager manager)
Deprecated. 
Create the ComponentLocator with a parent ComponentLocator

Method Detail

lookup

public Component lookup(java.lang.String role)
                 throws ComponentException
Deprecated. 
Return an instance of a component based on a Role. The Role is usually the Interface's Fully Qualified Name(FQN)--unless there are multiple Components for the same Role. In that case, the Role's FQN is appended with "Selector", and we return a ComponentSelector.

Specified by:
lookup in interface ComponentManager
Parameters:
role - The key name of the Component to retrieve.
Returns:
the desired component
Throws:
ComponentException - if an error occurs

hasComponent

public boolean hasComponent(java.lang.String role)
Deprecated. 
Tests for existence of a component. Please note that this test is for existing components, and a component will not be created to satisfy the request.

Specified by:
hasComponent in interface ComponentManager
Parameters:
role - a string identifying the key to check.
Returns:
True if the component exists, False if it does not.

release

public void release(Component component)
Deprecated. 
Release a Component. This implementation makes sure it has a handle on the propper ComponentHandler, and let's the ComponentHandler take care of the actual work.

Specified by:
release in interface ComponentManager
Parameters:
component - The Component we are releasing.

configure

public void configure(Configuration configuration)
               throws ConfigurationException
Deprecated. 
Configure the ComponentLocator.

Specified by:
configure in interface Configurable
Parameters:
configuration - the class configurations. Must not be null.
Throws:
ConfigurationException - if an error occurs

contextualize

public void contextualize(Context context)
Deprecated. 
Set up the Component's Context.

Specified by:
contextualize in interface Contextualizable
Parameters:
context - the context. Must not be null.

initialize

public void initialize()
                throws java.lang.Exception
Deprecated. 
Properly initialize of the Child handlers.

Specified by:
initialize in interface Initializable
Throws:
java.lang.Exception - if an error occurs

dispose

public void dispose()
Deprecated. 
Properly dispose of the Child handlers.

Specified by:
dispose in interface Disposable

setRoleManager

public void setRoleManager(RoleManager roles)
Deprecated. 
Configure the RoleManager

Specified by:
setRoleManager in interface RoleManageable

setLogKitManager

public void setLogKitManager(LogKitManager logkit)
Deprecated. 
Configure the LogKitManager

Specified by:
setLogKitManager in interface LogKitManageable
Parameters:
logkit - The LogKitManager fot child components.

setInstrumentManager

public void setInstrumentManager(InstrumentManager instrumentManager)
Deprecated. 
Sets the InstrumentManager for child components. Can be for special purpose components, however it is used mostly internally.

Specified by:
setInstrumentManager in interface InstrumentManageable
Parameters:
instrumentManager - The InstrumentManager for the component to use.

setInstrumentableName

public void setInstrumentableName(java.lang.String name)
Deprecated. 
Sets the name for the Instrumentable. The Instrumentable Name is used to uniquely identify the Instrumentable during the configuration of the InstrumentManager and to gain access to an InstrumentableDescriptor through the InstrumentManager. The value should be a string which does not contain spaces or periods.

This value may be set by a parent Instrumentable, or by the InstrumentManager using the value of the 'instrumentable' attribute in the configuration of the component.

Specified by:
setInstrumentableName in interface Instrumentable
Parameters:
name - The name used to identify a Instrumentable.

getInstrumentableName

public java.lang.String getInstrumentableName()
Deprecated. 
Gets the name of the Instrumentable.

Specified by:
getInstrumentableName in interface Instrumentable
Returns:
The name used to identify a Instrumentable.

getInstruments

public Instrument[] getInstruments()
Deprecated. 
Obtain a reference to all the Instruments that the Instrumentable object wishes to expose. All sampling is done directly through the Instruments as opposed to the Instrumentable interface.

Specified by:
getInstruments in interface Instrumentable
Returns:
An array of the Instruments available for profiling. Should never be null. If there are no Instruments, then EMPTY_INSTRUMENT_ARRAY can be returned. This should never be the case though unless there are child Instrumentables with Instruments.

getChildInstrumentables

public Instrumentable[] getChildInstrumentables()
Deprecated. 
Any Object which implements Instrumentable can also make use of other Instrumentable child objects. This method is used to tell the InstrumentManager about them.

Specified by:
getChildInstrumentables in interface Instrumentable
Returns:
An array of child Instrumentables. This method should never return null. If there are no child Instrumentables, then EMPTY_INSTRUMENTABLE_ARRAY can be returned.

setLoggerManager

public void setLoggerManager(LoggerManager logkit)
Deprecated. 
Configure the LoggerManager.

Specified by:
setLoggerManager in interface LoggerManageable
Parameters:
logkit - The LoggerManager for child components.

getComponentHandler

protected ComponentHandler getComponentHandler(java.lang.String role,
                                               java.lang.Class componentClass,
                                               Configuration configuration,
                                               Context context,
                                               RoleManager roleManager,
                                               LogkitLoggerManager logkitManager)
                                        throws java.lang.Exception
Deprecated. 
Obtain a new ComponentHandler for the specified component. This method allows classes which extend the ExcaliburComponentManager to use their own ComponentHandlers.

Parameters:
componentClass - Class of the component for which the handle is being requested.
configuration - The configuration for this component.
context - The current context object.
roleManager - The current RoleManager.
logkitManager - The current LogKitManager.
Throws:
java.lang.Exception - If there were any problems obtaining a ComponentHandler

addComponent

public void addComponent(java.lang.String role,
                         java.lang.Class component,
                         Configuration configuration)
                  throws ComponentException
Deprecated. 
Add a new component to the manager.

Parameters:
role - the role name for the new component.
component - the class of this component.
configuration - the configuration for this component.
Throws:
ComponentException

addComponentInstance

public void addComponentInstance(java.lang.String role,
                                 Component instance)
Deprecated. 
Add a static instance of a component to the manager.

Parameters:
role - the role name for the component.
instance - the instance of the component.


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