public final class ComponentFactory
extends org.apache.excalibur.instrument.AbstractLogEnabledInstrumentable
implements org.d_haven.mpool.ObjectFactory
| Modifier and Type | Class and Description |
|---|---|
protected class |
ComponentFactory.ClassInfo
This class collects all information about the components class:
- the constructor to use
- the parameters to pass into the constructor
- Additional infos about implemented methods
|
| Modifier and Type | Field and Description |
|---|---|
private ComponentFactory.ClassInfo |
m_classinfo
The class info for creating the component
|
private java.lang.Class |
m_componentClass
The class which this
ComponentFactory
should create. |
private org.apache.avalon.framework.logger.Logger |
m_componentLogger
The component's logger
|
private org.apache.avalon.framework.configuration.Configuration |
m_configuration
The configuration for this component.
|
private org.apache.avalon.framework.context.Context |
m_context
The Context for the component
|
private org.apache.excalibur.instrument.CounterInstrument |
m_dispose |
private LifecycleExtensionManager |
m_extManager
Lifecycle extensions manager
|
private org.apache.avalon.excalibur.logger.LoggerManager |
m_loggerManager
The LogKitManager for child ComponentSelectors
|
private org.apache.excalibur.instrument.CounterInstrument |
m_newInstance |
private org.apache.avalon.framework.service.ServiceManager |
m_serviceManager
The component manager for this component.
|
private boolean |
m_useDynamicCreation
Use the dynamic configuration
|
| Constructor and Description |
|---|
ComponentFactory(java.lang.Class componentClass,
org.apache.avalon.framework.configuration.Configuration configuration,
org.apache.avalon.framework.service.ServiceManager serviceManager,
org.apache.avalon.framework.context.Context context,
org.apache.avalon.excalibur.logger.LoggerManager loggerManager,
LifecycleExtensionManager extManager)
Construct a new component factory for the specified component.
|
| Modifier and Type | Method and Description |
|---|---|
private org.apache.avalon.framework.logger.Logger |
aquireLogger() |
protected void |
configureComponent(java.lang.Object component)
Configure the component
|
protected void |
contextualizeComponent(java.lang.Object component)
Contextualize the component
|
protected java.lang.Object |
createComponent()
Create a new component
|
void |
dispose(java.lang.Object component)
Disposal of the supplied component instance.
|
protected void |
enabledComponentLogging(java.lang.Object component)
Enable logging for the component
|
java.lang.Class |
getCreatedClass()
Returns the component class.
|
java.lang.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.
|
protected void |
serviceComponent(java.lang.Object component)
Service the component
|
addChildInstrumentable, addInstrument, getChildInstrumentables, getInstrumentableName, getInstruments, setInstrumentableNameprivate final org.apache.excalibur.instrument.CounterInstrument m_newInstance
private final org.apache.excalibur.instrument.CounterInstrument m_dispose
private final java.lang.Class m_componentClass
ComponentFactory
should create.private final org.apache.avalon.framework.context.Context m_context
private final org.apache.avalon.framework.service.ServiceManager m_serviceManager
private final org.apache.avalon.framework.configuration.Configuration m_configuration
private final org.apache.avalon.excalibur.logger.LoggerManager m_loggerManager
private final LifecycleExtensionManager m_extManager
private final org.apache.avalon.framework.logger.Logger m_componentLogger
private ComponentFactory.ClassInfo m_classinfo
private final boolean m_useDynamicCreation
public ComponentFactory(java.lang.Class componentClass,
org.apache.avalon.framework.configuration.Configuration configuration,
org.apache.avalon.framework.service.ServiceManager serviceManager,
org.apache.avalon.framework.context.Context context,
org.apache.avalon.excalibur.logger.LoggerManager loggerManager,
LifecycleExtensionManager extManager)
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.public java.lang.Object newInstance()
throws java.lang.Exception
newInstance in interface org.d_haven.mpool.ObjectFactoryjava.lang.Exceptionprivate org.apache.avalon.framework.logger.Logger aquireLogger()
public final java.lang.Class getCreatedClass()
getCreatedClass in interface org.d_haven.mpool.ObjectFactorypublic final void dispose(java.lang.Object component)
throws java.lang.Exception
dispose in interface org.d_haven.mpool.ObjectFactorycomponent - the component to dispose ofjava.lang.Exception - if a disposal error occursprotected java.lang.Object createComponent()
throws java.lang.Exception
java.lang.Exceptionprotected void enabledComponentLogging(java.lang.Object component)
throws java.lang.Exception
java.lang.Exceptionprotected void contextualizeComponent(java.lang.Object component)
throws java.lang.Exception
java.lang.Exceptionprotected void serviceComponent(java.lang.Object component)
throws java.lang.Exception
java.lang.Exceptionprotected void configureComponent(java.lang.Object component)
throws java.lang.Exception
java.lang.Exception