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
ServiceComponentLifecycleloadImplemtationClass in interface ServiceComponentLifecycleclassLoader - the classloader to use for loading the implementation classClassNotFoundException - loading of the class failedpublic Object getInstance() throws Exception
getInstance in interface ServiceComponentLifecycleException - the operation failedpublic void incarnate() throws Exception
ServiceComponentLifecycleincarnate in interface ServiceComponentLifecycleException - the operation failedpublic abstract void reconfigure() throws Exception
ServiceComponentLifecyclereconfigure in interface ServiceComponentLifecycleException - the operation failedpublic void decommision() throws Exception
ServiceComponentLifecycledecommision in interface ServiceComponentLifecycleException - the operation failedpublic void dispose()
ServiceComponentLifecycledispose in interface ServiceComponentLifecyclepublic void setLogger(org.apache.avalon.framework.logger.Logger logger)
ServiceComponentLifecyclesetLogger in interface ServiceComponentLifecyclelogger - The logger to setpublic 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 paramaters to set.public boolean isEarlyInit()
public String getName()
ServiceComponentgetName in interface ServiceComponentpublic RoleEntry getRoleEntry()
ServiceComponentgetRoleEntry 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()
ServiceComponentgetShorthand in interface ServiceComponentprotected 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.