|
||||||||||
| 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)
Constructor to parse the configuration. |
|
| Method Summary | |
|---|---|
protected 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()
|
Class |
getImplementationClazz()
|
Object |
getInstance()
|
org.apache.avalon.framework.logger.Logger |
getLogger()
|
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 Object |
getRawInstance(boolean useProxy)
Get either the original service object or the dynamic proxy |
RoleEntry |
getRoleEntry()
Returns the associates role entry parsed from the role configuration file. |
org.apache.avalon.framework.service.ServiceManager |
getServiceManager()
|
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(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(Object proxy)
|
void |
setServiceManager(org.apache.avalon.framework.service.ServiceManager serviceManager)
Sets the ServiceManager to be used by this component. |
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)
roleEntry - The information extracted from the role configuration fileparentLogger - the logger of the service containerlogger - The logger for the service instance| Method Detail |
|---|
public void loadImplemtationClass(ClassLoader classLoader)
throws ClassNotFoundException
ServiceComponentLifecycle
loadImplemtationClass in interface ServiceComponentLifecycleclassLoader - the classloader to use for loading the implementation class
ClassNotFoundException - loading of the class failedServiceComponentLifecycle.loadImplemtationClass(java.lang.ClassLoader)
public Object getInstance()
throws Exception
getInstance in interface ServiceComponentLifecycleException - the operation failedServiceComponentLifecycle.getInstance()
public void incarnate()
throws Exception
ServiceComponentLifecycle
incarnate in interface ServiceComponentLifecycleException - the operation failedServiceComponentLifecycle.incarnate()
public abstract void reconfigure()
throws Exception
ServiceComponentLifecycle
reconfigure in interface ServiceComponentLifecycleException - the operation failedServiceComponentLifecycle.reconfigure()
public void decommision()
throws Exception
ServiceComponentLifecycle
decommision in interface ServiceComponentLifecycleException - the operation failedServiceComponentLifecycle.decommision()public void dispose()
ServiceComponentLifecycle
dispose in interface ServiceComponentLifecycleServiceComponentLifecycle.dispose()public void setLogger(org.apache.avalon.framework.logger.Logger logger)
ServiceComponentLifecycle
setLogger in interface ServiceComponentLifecyclelogger - The logger to set.public void setContext(org.apache.avalon.framework.context.Context context)
ServiceComponentLifecycle
setContext in interface ServiceComponentLifecyclecontext - The context to set.public void setServiceManager(org.apache.avalon.framework.service.ServiceManager serviceManager)
ServiceComponentLifecycle
setServiceManager in interface ServiceComponentLifecycleserviceManager - The serviceManager to set.public void setConfiguration(org.apache.avalon.framework.configuration.Configuration configuration)
ServiceComponentLifecycle
setConfiguration in interface ServiceComponentLifecycleconfiguration - The configuration to set.public void setParameters(org.apache.avalon.framework.parameters.Parameters parameters)
ServiceComponentLifecycle
setParameters in interface ServiceComponentLifecycleparameters - The parameters to set.public boolean isEarlyInit()
public String getName()
ServiceComponent
getName in interface ServiceComponentServiceComponent.getName()public RoleEntry getRoleEntry()
ServiceComponent
getRoleEntry in interface ServiceComponentpublic org.apache.avalon.framework.logger.Logger getLogger()
public org.apache.avalon.framework.logger.Logger getParentLogger()
public 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 String getShorthand()
ServiceComponent
getShorthand in interface ServiceComponentpublic String toString()
toString in class ObjectObject.toString()protected final boolean isInstantiated()
protected Object createInstance()
throws InstantiationException,
IllegalAccessException
InstantiationException - th
IllegalAccessException
protected abstract void incarnateInstance()
throws Exception
ExceptionServiceComponentLifecycle.incarnate()protected Object getRawInstance(boolean useProxy)
protected void setProxyInstance(Object proxy)
proxy - the service proxy instance
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||