Klasse ServiceComponentImpl
java.lang.Object
org.apache.fulcrum.yaafi.framework.component.ServiceComponentImpl
- Alle implementierten Schnittstellen:
ServiceComponent,ServiceComponentLifecycle
- Bekannte direkte Unterklassen:
AvalonServiceComponentImpl
This class implements am abstract base service component singleton with
an arbitrary lifecycle.
- Autor:
- Siegfried Goeschl
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungServiceComponentImpl(RoleEntry roleEntry, org.apache.avalon.framework.logger.Logger parentLogger, org.apache.avalon.framework.logger.Logger logger) Constructor to parse the configuration. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungprotected ObjectCreate an instance of the service component implementation classvoidDecommisions a service component instance.voiddispose()Dispose a service component instance.org.apache.avalon.framework.configuration.Configurationorg.apache.avalon.framework.context.ContextClass<?>org.apache.avalon.framework.logger.LoggergetName()Get the unique name of the service component instance.org.apache.avalon.framework.parameters.Parametersorg.apache.avalon.framework.logger.Loggerprotected ObjectgetRawInstance(boolean useProxy) Get either the original service object or the dynamic proxyReturns the associates role entry parsed from the role configuration file.org.apache.avalon.framework.service.ServiceManagerGet the shorthand of the service component instance.voidIncarnates a service component instance.protected abstract voidbooleanprotected final booleanvoidloadImplemtationClass(ClassLoader classLoader) Loads the implementaion class.abstract voidReconfigures a service component instancevoidsetConfiguration(org.apache.avalon.framework.configuration.Configuration configuration) Sets the Configuration to be used by this component.voidsetContext(org.apache.avalon.framework.context.Context context) Sets the Context to be used by this component.voidsetLogger(org.apache.avalon.framework.logger.Logger logger) Sets the logger to be used by this component.voidsetParameters(org.apache.avalon.framework.parameters.Parameters parameters) Sets the Parameters to be used by this component.protected voidsetProxyInstance(Object proxy) voidsetServiceManager(org.apache.avalon.framework.service.ServiceManager serviceManager) Sets the ServiceManager to be used by this component.toString()
-
Konstruktordetails
-
ServiceComponentImpl
public ServiceComponentImpl(RoleEntry roleEntry, org.apache.avalon.framework.logger.Logger parentLogger, org.apache.avalon.framework.logger.Logger logger) Constructor to parse the configuration.- Parameter:
roleEntry- The information extracted from the role configuration fileparentLogger- the logger of the service containerlogger- The logger for the service instance
-
-
Methodendetails
-
loadImplemtationClass
Beschreibung aus Schnittstelle kopiert:ServiceComponentLifecycleLoads the implementaion class.- Angegeben von:
loadImplemtationClassin SchnittstelleServiceComponentLifecycle- Parameter:
classLoader- the classloader to use for loading the implementation class- Löst aus:
ClassNotFoundException- loading of the class failed
-
getInstance
- Angegeben von:
getInstancein SchnittstelleServiceComponentLifecycle- Gibt zurück:
- Returns the instance of the singleton
- Löst aus:
Exception- the operation failed
-
incarnate
Beschreibung aus Schnittstelle kopiert:ServiceComponentLifecycleIncarnates a service component instance.- Angegeben von:
incarnatein SchnittstelleServiceComponentLifecycle- Löst aus:
Exception- the operation failed
-
reconfigure
Beschreibung aus Schnittstelle kopiert:ServiceComponentLifecycleReconfigures a service component instance- Angegeben von:
reconfigurein SchnittstelleServiceComponentLifecycle- Löst aus:
Exception- the operation failed
-
decommision
Beschreibung aus Schnittstelle kopiert:ServiceComponentLifecycleDecommisions a service component instance.- Angegeben von:
decommisionin SchnittstelleServiceComponentLifecycle- Löst aus:
Exception- the operation failed
-
dispose
public void dispose()Beschreibung aus Schnittstelle kopiert:ServiceComponentLifecycleDispose a service component instance.- Angegeben von:
disposein SchnittstelleServiceComponentLifecycle
-
setLogger
public void setLogger(org.apache.avalon.framework.logger.Logger logger) Beschreibung aus Schnittstelle kopiert:ServiceComponentLifecycleSets the logger to be used by this component.- Angegeben von:
setLoggerin SchnittstelleServiceComponentLifecycle- Parameter:
logger- The logger to set
-
setContext
public void setContext(org.apache.avalon.framework.context.Context context) Beschreibung aus Schnittstelle kopiert:ServiceComponentLifecycleSets the Context to be used by this component.- Angegeben von:
setContextin SchnittstelleServiceComponentLifecycle- Parameter:
context- The context to set.
-
setServiceManager
public void setServiceManager(org.apache.avalon.framework.service.ServiceManager serviceManager) Beschreibung aus Schnittstelle kopiert:ServiceComponentLifecycleSets the ServiceManager to be used by this component.- Angegeben von:
setServiceManagerin SchnittstelleServiceComponentLifecycle- Parameter:
serviceManager- The serviceManager to set.
-
setConfiguration
public void setConfiguration(org.apache.avalon.framework.configuration.Configuration configuration) Beschreibung aus Schnittstelle kopiert:ServiceComponentLifecycleSets the Configuration to be used by this component.- Angegeben von:
setConfigurationin SchnittstelleServiceComponentLifecycle- Parameter:
configuration- The configuration to set.
-
setParameters
public void setParameters(org.apache.avalon.framework.parameters.Parameters parameters) Beschreibung aus Schnittstelle kopiert:ServiceComponentLifecycleSets the Parameters to be used by this component.- Angegeben von:
setParametersin SchnittstelleServiceComponentLifecycle- Parameter:
parameters- The paramaters to set.
-
isEarlyInit
public boolean isEarlyInit()- Gibt zurück:
- Return true if the service is created on startup
-
getName
Beschreibung aus Schnittstelle kopiert:ServiceComponentGet the unique name of the service component instance.- Angegeben von:
getNamein SchnittstelleServiceComponent- Gibt zurück:
- the name of the service component
-
getRoleEntry
Beschreibung aus Schnittstelle kopiert:ServiceComponentReturns the associates role entry parsed from the role configuration file.- Angegeben von:
getRoleEntryin SchnittstelleServiceComponent- Gibt zurück:
- the role entry
-
getLogger
public org.apache.avalon.framework.logger.Logger getLogger()- Gibt zurück:
- Returns the logger.
-
getParentLogger
public org.apache.avalon.framework.logger.Logger getParentLogger()- Gibt zurück:
- Returns the parentLogger.
-
getImplementationClazz
- Gibt zurück:
- Returns the implementationClazz.
-
getConfiguration
public org.apache.avalon.framework.configuration.Configuration getConfiguration()- Gibt zurück:
- Returns the configuration.
-
getContext
public org.apache.avalon.framework.context.Context getContext()- Gibt zurück:
- Returns the context.
-
getParamaters
public org.apache.avalon.framework.parameters.Parameters getParamaters()- Gibt zurück:
- Returns the parameters.
-
getServiceManager
public org.apache.avalon.framework.service.ServiceManager getServiceManager()- Gibt zurück:
- Returns the serviceManager.
-
getShorthand
Beschreibung aus Schnittstelle kopiert:ServiceComponentGet the shorthand of the service component instance. The shorthand is usually used to lookup the configuration entries.- Angegeben von:
getShorthandin SchnittstelleServiceComponent- Gibt zurück:
- the shorthand of the service
-
toString
-
isInstantiated
protected final boolean isInstantiated()- Gibt zurück:
- Returns true if the service instance was already instantiated.
-
createInstance
Create an instance of the service component implementation class- Gibt zurück:
- instance of the service component class
- Löst aus:
InstantiationException- if unable to instantiateIllegalAccessException- if unable to access
-
incarnateInstance
- Löst aus:
Exception- generic exception- Siehe auch:
-
getRawInstance
Get either the original service object or the dynamic proxy- Parameter:
useProxy- set to true if using a proxy- Gibt zurück:
- Returns the raw instance, i.e. does not incarnate the instance.
-
setProxyInstance
- Parameter:
proxy- the service proxy instance
-