org.apache.avalon.excalibur.component
Class ExcaliburComponentManager

java.lang.Object
  |
  +--org.apache.avalon.framework.logger.AbstractLoggable
        |
        +--org.apache.avalon.excalibur.component.ExcaliburComponentManager
All Implemented Interfaces:
org.apache.avalon.framework.component.ComponentManager, 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
Direct Known Subclasses:
DefaultComponentManager

public class ExcaliburComponentManager
extends org.apache.avalon.framework.logger.AbstractLoggable
implements org.apache.avalon.framework.component.ComponentManager, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.context.Contextualizable, org.apache.avalon.framework.activity.Initializable, org.apache.avalon.framework.activity.Disposable, RoleManageable, LogKitManageable

Default component manager for Avalon's components.

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

Constructor Summary
ExcaliburComponentManager()
          Create the ComponentManager
ExcaliburComponentManager(java.lang.ClassLoader loader)
          Create the ComponentManager with a Classloader
ExcaliburComponentManager(org.apache.avalon.framework.component.ComponentManager manager)
          Create the ComponentManager with a parent ComponentManager
ExcaliburComponentManager(org.apache.avalon.framework.component.ComponentManager manager, java.lang.ClassLoader loader)
          Create the ComponentManager with a Classloader and parent ComponentManager
 
Method Summary
 void addComponent(java.lang.String role, java.lang.Class component, org.apache.avalon.framework.configuration.Configuration configuration)
          Add a new component to the manager.
 void addComponentInstance(java.lang.String role, org.apache.avalon.framework.component.Component instance)
          Add a static instance of a component to the manager.
 void configure(org.apache.avalon.framework.configuration.Configuration configuration)
          Configure the ComponentManager.
 void contextualize(org.apache.avalon.framework.context.Context context)
          Set up the Component's Context.
 void dispose()
          Properly dispose of the Child handlers.
 boolean hasComponent(java.lang.String role)
          Tests for existence of a component.
 void initialize()
          Properly initialize of the Child handlers.
 org.apache.avalon.framework.component.Component lookup(java.lang.String role)
          Return an instance of a component based on a Role.
 void release(org.apache.avalon.framework.component.Component component)
          Release a Component.
 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
 

Constructor Detail

ExcaliburComponentManager

public ExcaliburComponentManager()
Create the ComponentManager

ExcaliburComponentManager

public ExcaliburComponentManager(java.lang.ClassLoader loader)
Create the ComponentManager with a Classloader

ExcaliburComponentManager

public ExcaliburComponentManager(org.apache.avalon.framework.component.ComponentManager manager,
                                 java.lang.ClassLoader loader)
Create the ComponentManager with a Classloader and parent ComponentManager

ExcaliburComponentManager

public ExcaliburComponentManager(org.apache.avalon.framework.component.ComponentManager manager)
Create the ComponentManager with a parent ComponentManager
Method Detail

contextualize

public void contextualize(org.apache.avalon.framework.context.Context context)
Set up the Component's Context.
Specified by:
contextualize in interface org.apache.avalon.framework.context.Contextualizable

hasComponent

public boolean hasComponent(java.lang.String role)
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 org.apache.avalon.framework.component.ComponentManager

initialize

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

dispose

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

lookup

public org.apache.avalon.framework.component.Component lookup(java.lang.String role)
                                                       throws org.apache.avalon.framework.component.ComponentException
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 org.apache.avalon.framework.component.ComponentManager

configure

public void configure(org.apache.avalon.framework.configuration.Configuration configuration)
               throws org.apache.avalon.framework.configuration.ConfigurationException
Configure the ComponentManager.
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 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 org.apache.avalon.framework.component.ComponentManager

addComponent

public void addComponent(java.lang.String role,
                         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:
role - the role name for the new component.
component - the class of this component.
Configuration - the configuration for this component.

addComponentInstance

public void addComponentInstance(java.lang.String role,
                                 org.apache.avalon.framework.component.Component instance)
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 © 2001 Apache Jakarta Project. All Rights Reserved.