public abstract class ServiceComponentImpl extends Object implements ServiceComponent
Constructor and Description |
---|
ServiceComponentImpl(RoleEntry roleEntry,
org.apache.avalon.framework.logger.Logger parentLogger,
org.apache.avalon.framework.logger.Logger logger)
Constructor to parse the configuration.
|
Modifier and Type | Method and Description |
---|---|
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() |
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 instancepublic void loadImplemtationClass(ClassLoader classLoader) throws ClassNotFoundException
ServiceComponentLifecycle
loadImplemtationClass
in interface ServiceComponentLifecycle
classLoader
- the classloader to use for loading the implementation classClassNotFoundException
- loading of the class failedpublic Object getInstance() throws Exception
getInstance
in interface ServiceComponentLifecycle
Exception
- the operation failedpublic void incarnate() throws Exception
ServiceComponentLifecycle
incarnate
in interface ServiceComponentLifecycle
Exception
- the operation failedpublic abstract void reconfigure() throws Exception
ServiceComponentLifecycle
reconfigure
in interface ServiceComponentLifecycle
Exception
- the operation failedpublic void decommision() throws Exception
ServiceComponentLifecycle
decommision
in interface ServiceComponentLifecycle
Exception
- the operation failedpublic void dispose()
ServiceComponentLifecycle
dispose
in interface ServiceComponentLifecycle
public void setLogger(org.apache.avalon.framework.logger.Logger logger)
ServiceComponentLifecycle
setLogger
in interface ServiceComponentLifecycle
logger
- The logger to setpublic 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 paramaters to set.public boolean isEarlyInit()
public String getName()
ServiceComponent
getName
in interface ServiceComponent
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 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 ServiceComponent
protected final boolean isInstantiated()
protected Object createInstance() throws InstantiationException, IllegalAccessException
InstantiationException
- if unable to instantiateIllegalAccessException
- if unable to accessprotected abstract void incarnateInstance() throws Exception
Exception
- generic exceptionServiceComponentLifecycle.incarnate()
protected Object getRawInstance(boolean useProxy)
useProxy
- set to true if using a proxyprotected void setProxyInstance(Object proxy)
proxy
- the service proxy instanceCopyright © 2004–1970 The Apache Software Foundation. All rights reserved.