|
|||||||||||
| 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
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 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(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()
Initialize the component. |
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(ServiceManager manager)
Pass the ServiceManager to the Serviceable. |
java.lang.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 Logger m_logger
protected LoggerManager m_loggerManager
| Constructor Detail |
public AbstractComponentHandler()
| Method Detail |
public void service(ServiceManager manager)
throws ServiceException
ServiceableServiceManager to the Serviceable.
The Serviceable implementation should use the specified
ServiceManager to acquire the components it needs for
execution.
service in interface Serviceablemanager - The ServiceManager which this
Serviceable uses. Must not be null.
ServiceException - if an error occurs
public void initialize()
throws java.lang.Exception
Initializable
initialize in interface Initializablejava.lang.Exception - if an error occurspublic java.lang.Class getComponentClass()
getComponentClass in interface ComponentHandlerClass object for the component
public void prepareHandler()
throws java.lang.Exception
prepareHandler in interface ComponentHandlerjava.lang.Exception - if unable to prepare handler
protected void doPrepare()
throws java.lang.Exception
java.lang.Exception - if there is a problem
public java.lang.Object get()
throws java.lang.Exception
get in interface ComponentHandlerjava.lang.Exception - if unable to ge tthe compoennt reference
protected 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 component
protected 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 Disposableprotected void doDispose()
public java.lang.String toString()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||