org.apache.avalon.fortress.impl.handler
Class ComponentFactory

java.lang.Object
  |
  +--org.apache.avalon.framework.logger.AbstractLogEnabled
        |
        +--org.apache.excalibur.instrument.AbstractLogEnabledInstrumentable
              |
              +--org.apache.avalon.fortress.impl.handler.ComponentFactory
All Implemented Interfaces:
Instrumentable, LogEnabled, ObjectFactory

public final class ComponentFactory
extends AbstractLogEnabledInstrumentable
implements ObjectFactory

Factory for Avalon components.

Since:
4.0
Version:
CVS $Revision: 1.25 $ $Date: 2003/05/28 16:11:01 $
Author:
Berin Loritsch, Paul Russell

Field Summary
 
Fields inherited from interface org.apache.excalibur.mpool.ObjectFactory
ROLE
 
Fields inherited from interface org.apache.excalibur.instrument.Instrumentable
EMPTY_INSTRUMENT_ARRAY, EMPTY_INSTRUMENTABLE_ARRAY
 
Constructor Summary
ComponentFactory(Class componentClass, Configuration configuration, ServiceManager serviceManager, Context context, LoggerManager loggerManager, LifecycleExtensionManager extManager)
          Construct a new component factory for the specified component.
 
Method Summary
 void dispose(Object component)
          Disposal of the supplied component instance.
 Class getCreatedClass()
          Returns the component class.
 Object newInstance()
          Returns a new instance of a component and optionally applies a logging channel, instrumentation, context, a component or service manager, configuration, parameters, lifecycle extensions, initialization, and execution phases based on the interfaces implemented by the component class.
 
Methods inherited from class org.apache.excalibur.instrument.AbstractLogEnabledInstrumentable
addChildInstrumentable, addInstrument, getChildInstrumentables, getInstrumentableName, getInstruments, setInstrumentableName
 
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
 

Constructor Detail

ComponentFactory

public ComponentFactory(Class componentClass,
                        Configuration configuration,
                        ServiceManager serviceManager,
                        Context context,
                        LoggerManager loggerManager,
                        LifecycleExtensionManager extManager)
Construct a new component factory for the specified component.

Parameters:
componentClass - the class to instantiate (must have a default constructor).
configuration - the Configuration object to pass to new instances.
serviceManager - the service manager to pass to Serviceables.
context - the Context to pass to Contexutalizables.
loggerManager - the loggerManager manager instance.
Method Detail

newInstance

public Object newInstance()
                   throws Exception
Returns a new instance of a component and optionally applies a logging channel, instrumentation, context, a component or service manager, configuration, parameters, lifecycle extensions, initialization, and execution phases based on the interfaces implemented by the component class.

Specified by:
newInstance in interface ObjectFactory
Returns:
the new instance
Exception

getCreatedClass

public final Class getCreatedClass()
Returns the component class.

Specified by:
getCreatedClass in interface ObjectFactory
Returns:
the class

dispose

public final void dispose(Object component)
                   throws Exception
Disposal of the supplied component instance.

Specified by:
dispose in interface ObjectFactory
Parameters:
component - the component to dispose of
Throws:
Exception - if a disposal error occurs


Copyright © 2000-2002 Apache Avalon Project. All Rights Reserved.