public abstract class AbstractComponentHandler extends org.apache.excalibur.instrument.AbstractLogEnabledInstrumentable implements org.apache.avalon.framework.service.Serviceable, org.apache.avalon.framework.activity.Initializable, org.apache.avalon.framework.activity.Disposable, ComponentHandler
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
m_disposed
State management boolean stating whether the Handler is disposed or
not
|
protected org.d_haven.mpool.ObjectFactory |
m_factory
The instance of the ComponentFactory that creates and disposes of the
Component
|
protected org.apache.avalon.framework.logger.Logger |
m_logger
Logger for factory
|
protected org.apache.avalon.excalibur.logger.LoggerManager |
m_loggerManager
Logger Manager
|
protected boolean |
m_prepared
State management boolean stating whether the Handler is initialized or
not
|
private org.apache.excalibur.instrument.CounterInstrument |
m_release |
private org.apache.excalibur.instrument.CounterInstrument |
m_request |
| Constructor and Description |
|---|
AbstractComponentHandler() |
| Modifier and Type | Method and Description |
|---|---|
void |
dispose()
Dispose of the ComponentHandler and any associated Pools and Factories.
|
protected void |
disposeComponent(java.lang.Object component)
Dispose of the specified component.
|
protected void |
doDispose()
Dispose handler specific resources.
|
protected abstract java.lang.Object |
doGet()
Subclasses should actually overide this to do the work
of retrieving a service.
|
protected void |
doPrepare()
Initialize the ComponentHandler.
|
protected void |
doPut(java.lang.Object component)
Subclasses should overide this to return component to handler.
|
java.lang.Object |
get()
Get a reference of the desired Component
|
java.lang.Class |
getComponentClass()
Return the component's class that this handler is trying to create.
|
void |
initialize() |
protected java.lang.Object |
newComponent()
Create a new component for handler.
|
void |
prepareHandler()
Actually prepare the handler and make it ready to
handle component access.
|
void |
put(java.lang.Object component)
Return a reference of the desired Component
|
void |
service(org.apache.avalon.framework.service.ServiceManager manager) |
java.lang.String |
toString()
Represents the handler as a string.
|
addChildInstrumentable, addInstrument, getChildInstrumentables, getInstrumentableName, getInstruments, setInstrumentableNameprivate org.apache.excalibur.instrument.CounterInstrument m_request
private org.apache.excalibur.instrument.CounterInstrument m_release
protected org.d_haven.mpool.ObjectFactory m_factory
protected boolean m_prepared
protected boolean m_disposed
protected org.apache.avalon.framework.logger.Logger m_logger
protected org.apache.avalon.excalibur.logger.LoggerManager m_loggerManager
public void service(org.apache.avalon.framework.service.ServiceManager manager)
throws org.apache.avalon.framework.service.ServiceException
service in interface org.apache.avalon.framework.service.Serviceableorg.apache.avalon.framework.service.ServiceExceptionpublic void initialize()
throws java.lang.Exception
initialize in interface org.apache.avalon.framework.activity.Initializablejava.lang.Exceptionpublic java.lang.Class getComponentClass()
getComponentClass in interface ComponentHandlerClass object for the componentpublic void prepareHandler()
throws java.lang.Exception
prepareHandler in interface ComponentHandlerjava.lang.Exception - if unable to prepare handlerprotected void doPrepare()
throws java.lang.Exception
java.lang.Exception - if there is a problempublic java.lang.Object get()
throws java.lang.Exception
get in interface ComponentHandlerjava.lang.Exception - if unable to ge tthe compoennt referenceprotected abstract java.lang.Object doGet()
throws java.lang.Exception
java.lang.Exception - if unable to aquire servicepublic void put(java.lang.Object component)
put in interface ComponentHandlercomponent - the componentprotected void doPut(java.lang.Object component)
component - the componentprotected java.lang.Object newComponent()
throws java.lang.Exception
java.lang.Exception - if unable to create new componentprotected void disposeComponent(java.lang.Object component)
component - the componentpublic void dispose()
dispose in interface org.apache.avalon.framework.activity.Disposableprotected void doDispose()
public java.lang.String toString()
toString in class java.lang.Object