org.apache.avalon.excalibur.component
Class ExcaliburComponentSelector

java.lang.Object
  extended byorg.apache.avalon.framework.logger.AbstractLogEnabled
      extended byorg.apache.avalon.excalibur.component.AbstractDualLogEnabled
          extended byorg.apache.avalon.excalibur.component.ExcaliburComponentSelector
All Implemented Interfaces:
Component, ComponentSelector, Composable, Configurable, Contextualizable, Disposable, Initializable, Instrumentable, InstrumentManageable, LogEnabled, Loggable, LoggerManageable, LogKitManageable, RoleManageable, ThreadSafe
Direct Known Subclasses:
DefaultComponentSelector

Deprecated. ECM is no longer supported

public class ExcaliburComponentSelector
extends AbstractDualLogEnabled
implements Contextualizable, ComponentSelector, Composable, Configurable, Initializable, ThreadSafe, Disposable, RoleManageable, LogKitManageable, LoggerManageable, InstrumentManageable, Instrumentable

Default component selector 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
protected  Context m_context
          Deprecated. The application context for components
 
Fields inherited from interface org.apache.excalibur.instrument.Instrumentable
EMPTY_INSTRUMENT_ARRAY, EMPTY_INSTRUMENTABLE_ARRAY
 
Constructor Summary
ExcaliburComponentSelector()
          Deprecated. Create the ComponentSelector
ExcaliburComponentSelector(java.lang.ClassLoader loader)
          Deprecated. Create the ComponentSelector with a Classloader
 
Method Summary
 void addComponent(java.lang.Object hint, java.lang.Class component, Configuration configuration)
          Deprecated. Add a new component to the manager.
 void addComponentInstance(java.lang.Object hint, Component instance)
          Deprecated. Add a static instance of a component to the manager.
protected  boolean canRelease(Component component)
          Deprecated. Is this component looked up using this selector?
 void compose(ComponentManager componentManager)
          Deprecated. Compose the ComponentSelector so that we know what the parent ComponentLocator is.
 void configure(Configuration configuration)
          Deprecated. Default Configuration handler for ComponentSelector.
 void contextualize(Context context)
          Deprecated. Provide the application Context.
 void dispose()
          Deprecated. Properly dispose of all the ComponentHandlers.
 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, ComponentManager componentManager, Context context, RoleManager roleManager, LogkitLoggerManager logkitManager)
          Deprecated. Obtain a new ComponentHandler for the specified component.
protected  java.util.Map getComponentHandlers()
          Deprecated. Makes the ComponentHandlers available to subclasses.
 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.Object hint)
          Deprecated. Tests for existence of a component.
 void initialize()
          Deprecated. Properly initialize of the Child handlers.
 void release(Component component)
          Deprecated. Release the Component to the propper ComponentHandler.
 Component select(java.lang.Object hint)
          Deprecated. Return an instance of a component based on a hint.
 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

m_context

protected Context m_context
Deprecated. 
The application context for components

Constructor Detail

ExcaliburComponentSelector

public ExcaliburComponentSelector()
Deprecated. 
Create the ComponentSelector


ExcaliburComponentSelector

public ExcaliburComponentSelector(java.lang.ClassLoader loader)
Deprecated. 
Create the ComponentSelector with a Classloader

Method Detail

contextualize

public void contextualize(Context context)
Deprecated. 
Provide the application Context.

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

select

public Component select(java.lang.Object hint)
                 throws ComponentException
Deprecated. 
Return an instance of a component based on a hint. The Composable has already selected the role, so the only part left it to make sure the Component is handled.

Specified by:
select in interface ComponentSelector
Parameters:
hint - A hint to retrieve the correct Component.
Returns:
the desired component
Throws:
ComponentException - If the given role is not associated with a Component, or a Component instance cannot be created.

hasComponent

public boolean hasComponent(java.lang.Object hint)
Deprecated. 
Tests for existence of a component.

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

release

public void release(Component component)
Deprecated. 
Release the Component to the propper ComponentHandler.

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

canRelease

protected boolean canRelease(Component component)
Deprecated. 
Is this component looked up using this selector?


compose

public void compose(ComponentManager componentManager)
             throws ComponentException
Deprecated. 
Compose the ComponentSelector so that we know what the parent ComponentLocator is.

Specified by:
compose in interface Composable
Parameters:
componentManager - The ComponentManager which this Composable uses. Must not be null.
Throws:
ComponentException - if an error occurs

configure

public void configure(Configuration configuration)
               throws ConfigurationException
Deprecated. 
Default Configuration handler for ComponentSelector.

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

initialize

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

Specified by:
initialize in interface Initializable

dispose

public void dispose()
Deprecated. 
Properly dispose of all the ComponentHandlers.

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,
                                               ComponentManager componentManager,
                                               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 ExcaliburComponentSelector to use their own ComponentHandlers.

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.
logkitManager - The current LogKitManager.
Throws:
java.lang.Exception - If there were any problems obtaining a ComponentHandler

getComponentHandlers

protected java.util.Map getComponentHandlers()
Deprecated. 
Makes the ComponentHandlers available to subclasses.

Returns:
A reference to the componentHandler Map.

addComponent

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

Parameters:
hint - the hint 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.Object hint,
                                 Component instance)
Deprecated. 
Add a static instance of a component to the manager.

Parameters:
hint - the hint for the component.
instance - the instance of the component.


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