org.apache.avalon.excalibur.component
Class ExcaliburComponentSelector

java.lang.Object
  |
  +--org.apache.avalon.framework.logger.AbstractLoggable
        |
        +--org.apache.avalon.excalibur.component.ExcaliburComponentSelector
All Implemented Interfaces:
org.apache.avalon.framework.component.Component, org.apache.avalon.framework.component.ComponentSelector, org.apache.avalon.framework.component.Composable, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.context.Contextualizable, org.apache.avalon.framework.activity.Disposable, org.apache.avalon.framework.activity.Initializable, org.apache.avalon.framework.logger.Loggable, LogKitManageable, RoleManageable, org.apache.avalon.framework.thread.ThreadSafe
Direct Known Subclasses:
DefaultComponentSelector

public class ExcaliburComponentSelector
extends org.apache.avalon.framework.logger.AbstractLoggable
implements org.apache.avalon.framework.context.Contextualizable, org.apache.avalon.framework.component.ComponentSelector, org.apache.avalon.framework.component.Composable, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.activity.Initializable, org.apache.avalon.framework.thread.ThreadSafe, org.apache.avalon.framework.activity.Disposable, RoleManageable, LogKitManageable

Default component selector for Avalon's components.

Since:
4.0
Version:
CVS $Revision: 1.10 $ $Date: 2002/01/30 16:49:05 $
Author:
Berin Loritsch, Paul Russell

Field Summary
protected  org.apache.avalon.framework.context.Context m_context
          The application context for components
 
Constructor Summary
ExcaliburComponentSelector()
          Create the ComponentSelector
ExcaliburComponentSelector(java.lang.ClassLoader loader)
          Create the ComponentSelector with a Classloader
 
Method Summary
 void addComponent(java.lang.Object hint, java.lang.Class component, org.apache.avalon.framework.configuration.Configuration configuration)
          Add a new component to the manager.
 void addComponentInstance(java.lang.Object hint, org.apache.avalon.framework.component.Component instance)
          Add a static instance of a component to the manager.
 void compose(org.apache.avalon.framework.component.ComponentManager componentManager)
          Compose the ComponentSelector so that we know what the parent ComponentManager is.
 void configure(org.apache.avalon.framework.configuration.Configuration configuration)
          Default Configuration handler for ComponentSelector.
 void contextualize(org.apache.avalon.framework.context.Context context)
          Provide the application Context.
 void dispose()
          Properly dispose of all the ComponentHandlers.
 boolean hasComponent(java.lang.Object hint)
          Tests for existence of a component.
 void initialize()
          Properly initialize of the Child handlers.
 void release(org.apache.avalon.framework.component.Component component)
          Release the Component to the propper ComponentHandler.
 org.apache.avalon.framework.component.Component select(java.lang.Object hint)
          Return an instance of a component based on a hint.
 void setLogKitManager(LogKitManager logkit)
          Configure the LogKitManager
 void setRoleManager(RoleManager roles)
          Configure the RoleManager
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLoggable
getLogger, setLogger, 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 org.apache.avalon.framework.context.Context m_context
The application context for components
Constructor Detail

ExcaliburComponentSelector

public ExcaliburComponentSelector()
Create the ComponentSelector

ExcaliburComponentSelector

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

contextualize

public void contextualize(org.apache.avalon.framework.context.Context context)
Provide the application Context.
Specified by:
contextualize in interface org.apache.avalon.framework.context.Contextualizable

compose

public void compose(org.apache.avalon.framework.component.ComponentManager componentManager)
             throws org.apache.avalon.framework.component.ComponentException
Compose the ComponentSelector so that we know what the parent ComponentManager is.
Specified by:
compose in interface org.apache.avalon.framework.component.Composable

initialize

public void initialize()
Properly initialize of the Child handlers.
Specified by:
initialize in interface org.apache.avalon.framework.activity.Initializable

hasComponent

public boolean hasComponent(java.lang.Object hint)
Tests for existence of a component.
Specified by:
hasComponent in interface org.apache.avalon.framework.component.ComponentSelector

dispose

public void dispose()
Properly dispose of all the ComponentHandlers.
Specified by:
dispose in interface org.apache.avalon.framework.activity.Disposable

select

public org.apache.avalon.framework.component.Component select(java.lang.Object hint)
                                                       throws org.apache.avalon.framework.component.ComponentException
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 org.apache.avalon.framework.component.ComponentSelector

configure

public void configure(org.apache.avalon.framework.configuration.Configuration configuration)
               throws org.apache.avalon.framework.configuration.ConfigurationException
Default Configuration handler for ComponentSelector.
Specified by:
configure in interface org.apache.avalon.framework.configuration.Configurable

setRoleManager

public void setRoleManager(RoleManager roles)
Configure the RoleManager
Specified by:
setRoleManager in interface RoleManageable

setLogKitManager

public void setLogKitManager(LogKitManager logkit)
Configure the LogKitManager
Specified by:
setLogKitManager in interface LogKitManageable

release

public void release(org.apache.avalon.framework.component.Component component)
Release the Component to the propper ComponentHandler.
Specified by:
release in interface org.apache.avalon.framework.component.ComponentSelector

addComponent

public void addComponent(java.lang.Object hint,
                         java.lang.Class component,
                         org.apache.avalon.framework.configuration.Configuration configuration)
                  throws org.apache.avalon.framework.component.ComponentException
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.

addComponentInstance

public void addComponentInstance(java.lang.Object hint,
                                 org.apache.avalon.framework.component.Component instance)
Add a static instance of a component to the manager.
Parameters:
hint - the hint for the component.
instance - the instance of the component.


Copyright © 2001 Apache Jakarta Project. All Rights Reserved.