Klasse ServiceComponentImpl

java.lang.Object
org.apache.fulcrum.yaafi.framework.component.ServiceComponentImpl
Alle implementierten Schnittstellen:
ServiceComponent, ServiceComponentLifecycle
Bekannte direkte Unterklassen:
AvalonServiceComponentImpl

public abstract class ServiceComponentImpl extends Object implements ServiceComponent
This class implements am abstract base service component singleton with an arbitrary lifecycle.
Autor:
Siegfried Goeschl
  • 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 file
      parentLogger - the logger of the service container
      logger - The logger for the service instance
  • Methodendetails

    • loadImplemtationClass

      public void loadImplemtationClass(ClassLoader classLoader) throws ClassNotFoundException
      Beschreibung aus Schnittstelle kopiert: ServiceComponentLifecycle
      Loads the implementaion class.
      Angegeben von:
      loadImplemtationClass in Schnittstelle ServiceComponentLifecycle
      Parameter:
      classLoader - the classloader to use for loading the implementation class
      Löst aus:
      ClassNotFoundException - loading of the class failed
    • getInstance

      public Object getInstance() throws Exception
      Angegeben von:
      getInstance in Schnittstelle ServiceComponentLifecycle
      Gibt zurück:
      Returns the instance of the singleton
      Löst aus:
      Exception - the operation failed
    • incarnate

      public void incarnate() throws Exception
      Beschreibung aus Schnittstelle kopiert: ServiceComponentLifecycle
      Incarnates a service component instance.
      Angegeben von:
      incarnate in Schnittstelle ServiceComponentLifecycle
      Löst aus:
      Exception - the operation failed
    • reconfigure

      public abstract void reconfigure() throws Exception
      Beschreibung aus Schnittstelle kopiert: ServiceComponentLifecycle
      Reconfigures a service component instance
      Angegeben von:
      reconfigure in Schnittstelle ServiceComponentLifecycle
      Löst aus:
      Exception - the operation failed
    • decommision

      public void decommision() throws Exception
      Beschreibung aus Schnittstelle kopiert: ServiceComponentLifecycle
      Decommisions a service component instance.
      Angegeben von:
      decommision in Schnittstelle ServiceComponentLifecycle
      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 Schnittstelle ServiceComponentLifecycle
    • 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 Schnittstelle ServiceComponentLifecycle
      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 Schnittstelle ServiceComponentLifecycle
      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 Schnittstelle ServiceComponentLifecycle
      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 Schnittstelle ServiceComponentLifecycle
      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 Schnittstelle ServiceComponentLifecycle
      Parameter:
      parameters - The paramaters to set.
    • isEarlyInit

      public boolean isEarlyInit()
      Gibt zurück:
      Return true if the service is created on startup
    • getName

      public String getName()
      Beschreibung aus Schnittstelle kopiert: ServiceComponent
      Get the unique name of the service component instance.
      Angegeben von:
      getName in Schnittstelle ServiceComponent
      Gibt zurück:
      the name of the service component
    • getRoleEntry

      public RoleEntry getRoleEntry()
      Beschreibung aus Schnittstelle kopiert: ServiceComponent
      Returns the associates role entry parsed from the role configuration file.
      Angegeben von:
      getRoleEntry in Schnittstelle ServiceComponent
      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

      public Class<?> 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

      public String 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 Schnittstelle ServiceComponent
      Gibt zurück:
      the shorthand of the service
    • toString

      public String toString()
      Setzt außer Kraft:
      toString in Klasse Object
    • isInstantiated

      protected final boolean isInstantiated()
      Gibt zurück:
      Returns true if the service instance was already instantiated.
    • createInstance

      protected Object createInstance() throws InstantiationException, IllegalAccessException
      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 instantiate
      IllegalAccessException - if unable to access
    • incarnateInstance

      protected abstract void incarnateInstance() throws Exception
      Löst aus:
      Exception - generic exception
      Siehe auch:
    • getRawInstance

      protected Object getRawInstance(boolean useProxy)
      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

      protected void setProxyInstance(Object proxy)
      Parameter:
      proxy - the service proxy instance