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 Object
Create an instance of the service component implementation classvoid
Decommisions a service component instance.void
dispose()
Dispose a service component instance.org.apache.avalon.framework.configuration.Configuration
org.apache.avalon.framework.context.Context
Class<?>
org.apache.avalon.framework.logger.Logger
getName()
Get the unique name of the service component instance.org.apache.avalon.framework.parameters.Parameters
org.apache.avalon.framework.logger.Logger
protected Object
getRawInstance
(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.ServiceManager
Get the shorthand of the service component instance.void
Incarnates a service component instance.protected abstract void
boolean
protected final boolean
void
loadImplemtationClass
(ClassLoader classLoader) Loads the implementaion class.abstract void
Reconfigures a service component instancevoid
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.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:ServiceComponentLifecycle
Loads the implementaion class.- Angegeben von:
loadImplemtationClass
in SchnittstelleServiceComponentLifecycle
- Parameter:
classLoader
- the classloader to use for loading the implementation class- Löst aus:
ClassNotFoundException
- loading of the class failed
-
getInstance
- Angegeben von:
getInstance
in SchnittstelleServiceComponentLifecycle
- Gibt zurück:
- Returns the instance of the singleton
- Löst aus:
Exception
- the operation failed
-
incarnate
Beschreibung aus Schnittstelle kopiert:ServiceComponentLifecycle
Incarnates a service component instance.- Angegeben von:
incarnate
in SchnittstelleServiceComponentLifecycle
- Löst aus:
Exception
- the operation failed
-
reconfigure
Beschreibung aus Schnittstelle kopiert:ServiceComponentLifecycle
Reconfigures a service component instance- Angegeben von:
reconfigure
in SchnittstelleServiceComponentLifecycle
- Löst aus:
Exception
- the operation failed
-
decommision
Beschreibung aus Schnittstelle kopiert:ServiceComponentLifecycle
Decommisions a service component instance.- Angegeben von:
decommision
in SchnittstelleServiceComponentLifecycle
- Löst aus:
Exception
- the operation failed
-
dispose
public void dispose()Beschreibung aus Schnittstelle kopiert:ServiceComponentLifecycle
Dispose a service component instance.- Angegeben von:
dispose
in SchnittstelleServiceComponentLifecycle
-
setLogger
public void setLogger(org.apache.avalon.framework.logger.Logger logger) Beschreibung aus Schnittstelle kopiert:ServiceComponentLifecycle
Sets the logger to be used by this component.- Angegeben von:
setLogger
in SchnittstelleServiceComponentLifecycle
- Parameter:
logger
- The logger to set
-
setContext
public void setContext(org.apache.avalon.framework.context.Context context) Beschreibung aus Schnittstelle kopiert:ServiceComponentLifecycle
Sets the Context to be used by this component.- Angegeben von:
setContext
in SchnittstelleServiceComponentLifecycle
- Parameter:
context
- The context to set.
-
setServiceManager
public void setServiceManager(org.apache.avalon.framework.service.ServiceManager serviceManager) Beschreibung aus Schnittstelle kopiert:ServiceComponentLifecycle
Sets the ServiceManager to be used by this component.- Angegeben von:
setServiceManager
in SchnittstelleServiceComponentLifecycle
- Parameter:
serviceManager
- The serviceManager to set.
-
setConfiguration
public void setConfiguration(org.apache.avalon.framework.configuration.Configuration configuration) Beschreibung aus Schnittstelle kopiert:ServiceComponentLifecycle
Sets the Configuration to be used by this component.- Angegeben von:
setConfiguration
in SchnittstelleServiceComponentLifecycle
- Parameter:
configuration
- The configuration to set.
-
setParameters
public void setParameters(org.apache.avalon.framework.parameters.Parameters parameters) Beschreibung aus Schnittstelle kopiert:ServiceComponentLifecycle
Sets the Parameters to be used by this component.- Angegeben von:
setParameters
in 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:ServiceComponent
Get the unique name of the service component instance.- Angegeben von:
getName
in SchnittstelleServiceComponent
- Gibt zurück:
- the name of the service component
-
getRoleEntry
Beschreibung aus Schnittstelle kopiert:ServiceComponent
Returns the associates role entry parsed from the role configuration file.- Angegeben von:
getRoleEntry
in 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:ServiceComponent
Get the shorthand of the service component instance. The shorthand is usually used to lookup the configuration entries.- Angegeben von:
getShorthand
in 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
-