|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.fulcrum.yaafi.framework.component.ServiceComponentImpl
public abstract class ServiceComponentImpl
This class implements am abstract base service component singleton with an arbitrary lifecycle.
Constructor Summary | |
---|---|
ServiceComponentImpl(RoleEntry roleEntry,
org.apache.avalon.framework.logger.Logger parentLogger,
org.apache.avalon.framework.logger.Logger logger,
ReadWriteLock readWriteLock)
Constructor to parse the configuration. |
Method Summary | |
---|---|
protected java.lang.Object |
createInstance()
Create an instance of the service component implementation class |
void |
decommision()
Decommisions a service component instance. |
void |
dispose()
Dispose a service component instance. |
org.apache.avalon.framework.configuration.Configuration |
getConfiguration()
|
org.apache.avalon.framework.context.Context |
getContext()
|
java.lang.Class |
getImplementationClazz()
|
java.lang.Object |
getInstance()
|
org.apache.avalon.framework.logger.Logger |
getLogger()
|
java.lang.String |
getName()
Get the unique name of the service component instance. |
org.apache.avalon.framework.parameters.Parameters |
getParamaters()
|
org.apache.avalon.framework.logger.Logger |
getParentLogger()
|
protected java.lang.Object |
getRawInstance(boolean useProxy)
Get either the original service object or the dynamic proxy |
protected ReadWriteLock |
getReadWriteLock()
|
RoleEntry |
getRoleEntry()
Returns the associates role entry parsed from the role configuration file. |
org.apache.avalon.framework.service.ServiceManager |
getServiceManager()
|
java.lang.String |
getShorthand()
Get the shorthand of the service component instance. |
void |
incarnate()
Incarnates a service component instance. |
protected abstract void |
incarnateInstance()
|
boolean |
isEarlyInit()
|
protected boolean |
isInstantiated()
|
void |
loadImplemtationClass(java.lang.ClassLoader classLoader)
Loads the implementaion class. |
abstract void |
reconfigure()
Reconfigures a service component instance |
void |
setConfiguration(org.apache.avalon.framework.configuration.Configuration configuration)
Sets the Configuration to be used by this component. |
void |
setContext(org.apache.avalon.framework.context.Context context)
Sets the Context to be used by this component. |
void |
setLogger(org.apache.avalon.framework.logger.Logger logger)
Sets the logger to be used by this component. |
void |
setParameters(org.apache.avalon.framework.parameters.Parameters parameters)
Sets the Parameters to be used by this component. |
protected void |
setProxyInstance(java.lang.Object proxy)
|
void |
setServiceManager(org.apache.avalon.framework.service.ServiceManager serviceManager)
Sets the ServiceManager to be used by this component. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ServiceComponentImpl(RoleEntry roleEntry, org.apache.avalon.framework.logger.Logger parentLogger, org.apache.avalon.framework.logger.Logger logger, ReadWriteLock readWriteLock)
roleEntry
- The information extracted from the role configuration fileparentLogger
- the logger of the service containerlogger
- The logger for the service instancereadWriteLock
- the read/write lock to synchronize access to servicesMethod Detail |
---|
public void loadImplemtationClass(java.lang.ClassLoader classLoader) throws java.lang.ClassNotFoundException
ServiceComponentLifecycle
loadImplemtationClass
in interface ServiceComponentLifecycle
classLoader
- the classloader to use for loading the implementation class
java.lang.ClassNotFoundException
- loading of the class failedServiceComponentLifecycle.loadImplemtationClass(java.lang.ClassLoader)
public java.lang.Object getInstance() throws java.lang.Exception
getInstance
in interface ServiceComponentLifecycle
java.lang.Exception
- the operation failedServiceComponentLifecycle.getInstance()
public void incarnate() throws java.lang.Exception
ServiceComponentLifecycle
incarnate
in interface ServiceComponentLifecycle
java.lang.Exception
- the operation failedServiceComponentLifecycle.incarnate()
public abstract void reconfigure() throws java.lang.Exception
ServiceComponentLifecycle
reconfigure
in interface ServiceComponentLifecycle
java.lang.Exception
- the operation failedServiceComponentLifecycle.reconfigure()
public void decommision() throws java.lang.Exception
ServiceComponentLifecycle
decommision
in interface ServiceComponentLifecycle
java.lang.Exception
- the operation failedServiceComponentLifecycle.decommision()
public void dispose()
ServiceComponentLifecycle
dispose
in interface ServiceComponentLifecycle
ServiceComponentLifecycle.dispose()
public void setLogger(org.apache.avalon.framework.logger.Logger logger)
ServiceComponentLifecycle
setLogger
in interface ServiceComponentLifecycle
logger
- The logger to set.public void setContext(org.apache.avalon.framework.context.Context context)
ServiceComponentLifecycle
setContext
in interface ServiceComponentLifecycle
context
- The context to set.public void setServiceManager(org.apache.avalon.framework.service.ServiceManager serviceManager)
ServiceComponentLifecycle
setServiceManager
in interface ServiceComponentLifecycle
serviceManager
- The serviceManager to set.public void setConfiguration(org.apache.avalon.framework.configuration.Configuration configuration)
ServiceComponentLifecycle
setConfiguration
in interface ServiceComponentLifecycle
configuration
- The configuration to set.public void setParameters(org.apache.avalon.framework.parameters.Parameters parameters)
ServiceComponentLifecycle
setParameters
in interface ServiceComponentLifecycle
parameters
- The parameters to set.public boolean isEarlyInit()
public java.lang.String getName()
ServiceComponent
getName
in interface ServiceComponent
ServiceComponent.getName()
public RoleEntry getRoleEntry()
ServiceComponent
getRoleEntry
in interface ServiceComponent
public org.apache.avalon.framework.logger.Logger getLogger()
public org.apache.avalon.framework.logger.Logger getParentLogger()
public java.lang.Class getImplementationClazz()
public org.apache.avalon.framework.configuration.Configuration getConfiguration()
public org.apache.avalon.framework.context.Context getContext()
public org.apache.avalon.framework.parameters.Parameters getParamaters()
public org.apache.avalon.framework.service.ServiceManager getServiceManager()
public java.lang.String getShorthand()
ServiceComponent
getShorthand
in interface ServiceComponent
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
protected final boolean isInstantiated()
protected java.lang.Object createInstance() throws java.lang.InstantiationException, java.lang.IllegalAccessException
java.lang.InstantiationException
- th
java.lang.IllegalAccessException
protected abstract void incarnateInstance() throws java.lang.Exception
java.lang.Exception
ServiceComponentLifecycle.incarnate()
protected java.lang.Object getRawInstance(boolean useProxy)
protected void setProxyInstance(java.lang.Object proxy)
proxy
- the service proxy instanceprotected final ReadWriteLock getReadWriteLock()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |