|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.excalibur.instrument.AbstractLogEnabledInstrumentable
org.apache.avalon.fortress.impl.handler.AbstractComponentHandler
public abstract class AbstractComponentHandler
AbstractComponentHandler class, ensures components are initialized and destroyed correctly.
Field Summary | |
---|---|
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 LoggerManager |
m_loggerManager
Logger Manager |
protected boolean |
m_prepared
State management boolean stating whether the Handler is initialized or not |
Fields inherited from interface org.apache.excalibur.instrument.Instrumentable |
---|
EMPTY_INSTRUMENT_ARRAY, EMPTY_INSTRUMENTABLE_ARRAY |
Constructor Summary | |
---|---|
AbstractComponentHandler()
|
Method Summary | |
---|---|
void |
dispose()
Dispose of the ComponentHandler and any associated Pools and Factories. |
protected void |
disposeComponent(Object component)
Dispose of the specified component. |
protected void |
doDispose()
Dispose handler specific resources. |
protected abstract Object |
doGet()
Subclasses should actually overide this to do the work of retrieving a service. |
protected void |
doPrepare()
Initialize the ComponentHandler. |
protected void |
doPut(Object component)
Subclasses should overide this to return component to handler. |
Object |
get()
Get a reference of the desired Component |
Class |
getComponentClass()
Return the component's class that this handler is trying to create. |
void |
initialize()
|
protected Object |
newComponent()
Create a new component for handler. |
void |
prepareHandler()
Actually prepare the handler and make it ready to handle component access. |
void |
put(Object component)
Return a reference of the desired Component |
void |
service(org.apache.avalon.framework.service.ServiceManager manager)
|
String |
toString()
Represents the handler as a string. |
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, wait, wait, wait |
Field Detail |
---|
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 LoggerManager m_loggerManager
Constructor Detail |
---|
public AbstractComponentHandler()
Method Detail |
---|
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.Serviceable
org.apache.avalon.framework.service.ServiceException
public void initialize() throws Exception
initialize
in interface org.apache.avalon.framework.activity.Initializable
Exception
public Class getComponentClass()
getComponentClass
in interface ComponentHandler
Class
object for the componentpublic void prepareHandler() throws Exception
prepareHandler
in interface ComponentHandler
Exception
- if unable to prepare handlerprotected void doPrepare() throws Exception
Exception
- if there is a problempublic Object get() throws Exception
get
in interface ComponentHandler
Exception
- if unable to ge tthe compoennt referenceprotected abstract Object doGet() throws Exception
Exception
- if unable to aquire servicepublic void put(Object component)
put
in interface ComponentHandler
component
- the componentprotected void doPut(Object component)
component
- the componentprotected Object newComponent() throws Exception
Exception
- if unable to create new componentprotected void disposeComponent(Object component)
component
- the componentpublic void dispose()
dispose
in interface org.apache.avalon.framework.activity.Disposable
protected void doDispose()
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |