public abstract class ServiceComponentImpl extends java.lang.Object implements ServiceComponent
| Constructor and Description |
|---|
ServiceComponentImpl(RoleEntry roleEntry,
org.apache.avalon.framework.logger.Logger parentLogger,
org.apache.avalon.framework.logger.Logger logger,
ReadWriteLock readWriteLock)
Constructor to parse the configuration.
|
| Modifier and Type | Method and Description |
|---|---|
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() |
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 servicespublic void loadImplemtationClass(java.lang.ClassLoader classLoader)
throws java.lang.ClassNotFoundException
ServiceComponentLifecycleloadImplemtationClass in interface ServiceComponentLifecycleclassLoader - the classloader to use for loading the implementation classjava.lang.ClassNotFoundException - loading of the class failedServiceComponentLifecycle.loadImplemtationClass(java.lang.ClassLoader)public java.lang.Object getInstance()
throws java.lang.Exception
getInstance in interface ServiceComponentLifecyclejava.lang.Exception - the operation failedServiceComponentLifecycle.getInstance()public void incarnate()
throws java.lang.Exception
ServiceComponentLifecycleincarnate in interface ServiceComponentLifecyclejava.lang.Exception - the operation failedServiceComponentLifecycle.incarnate()public abstract void reconfigure()
throws java.lang.Exception
ServiceComponentLifecyclereconfigure in interface ServiceComponentLifecyclejava.lang.Exception - the operation failedServiceComponentLifecycle.reconfigure()public void decommision()
throws java.lang.Exception
ServiceComponentLifecycledecommision in interface ServiceComponentLifecyclejava.lang.Exception - the operation failedServiceComponentLifecycle.decommision()public void dispose()
ServiceComponentLifecycledispose in interface ServiceComponentLifecycleServiceComponentLifecycle.dispose()public void setLogger(org.apache.avalon.framework.logger.Logger logger)
ServiceComponentLifecyclesetLogger in interface ServiceComponentLifecyclelogger - The logger to set.public void setContext(org.apache.avalon.framework.context.Context context)
ServiceComponentLifecyclesetContext in interface ServiceComponentLifecyclecontext - The context to set.public void setServiceManager(org.apache.avalon.framework.service.ServiceManager serviceManager)
ServiceComponentLifecyclesetServiceManager in interface ServiceComponentLifecycleserviceManager - The serviceManager to set.public void setConfiguration(org.apache.avalon.framework.configuration.Configuration configuration)
ServiceComponentLifecyclesetConfiguration in interface ServiceComponentLifecycleconfiguration - The configuration to set.public void setParameters(org.apache.avalon.framework.parameters.Parameters parameters)
ServiceComponentLifecyclesetParameters in interface ServiceComponentLifecycleparameters - The parameters to set.public boolean isEarlyInit()
public java.lang.String getName()
ServiceComponentgetName in interface ServiceComponentServiceComponent.getName()public RoleEntry getRoleEntry()
ServiceComponentgetRoleEntry in interface ServiceComponentpublic 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()
ServiceComponentgetShorthand in interface ServiceComponentpublic java.lang.String toString()
toString in class java.lang.ObjectObject.toString()protected final boolean isInstantiated()
protected java.lang.Object createInstance()
throws java.lang.InstantiationException,
java.lang.IllegalAccessException
java.lang.InstantiationException - thjava.lang.IllegalAccessExceptionprotected abstract void incarnateInstance()
throws java.lang.Exception
java.lang.ExceptionServiceComponentLifecycle.incarnate()protected java.lang.Object getRawInstance(boolean useProxy)
protected void setProxyInstance(java.lang.Object proxy)
proxy - the service proxy instanceprotected final ReadWriteLock getReadWriteLock()
Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.