Class BaseServiceImpl

java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.fulcrum.yaafi.service.baseservice.BaseServiceImpl
All Implemented Interfaces:
org.apache.avalon.framework.activity.Disposable, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.configuration.Reconfigurable, org.apache.avalon.framework.context.Contextualizable, org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.framework.parameters.Parameterizable, org.apache.avalon.framework.service.Serviceable, BaseService

public abstract class BaseServiceImpl extends org.apache.avalon.framework.logger.AbstractLogEnabled implements BaseService
Base class for a service implementation capturing the Avalon serviceConfiguration artifacts. Take care that using this class introduces a dependency to the YAAFI library.
Author:
Siegfried Goeschl
  • Constructor Details

    • BaseServiceImpl

      public BaseServiceImpl()
      Constructor
  • Method Details

    • contextualize

      public void contextualize(org.apache.avalon.framework.context.Context context) throws org.apache.avalon.framework.context.ContextException
      Specified by:
      contextualize in interface org.apache.avalon.framework.context.Contextualizable
      Throws:
      org.apache.avalon.framework.context.ContextException
      See Also:
      • Contextualizable.contextualize(org.apache.avalon.framework.context.Context)
    • service

      public void service(org.apache.avalon.framework.service.ServiceManager serviceManager) throws org.apache.avalon.framework.service.ServiceException
      Specified by:
      service in interface org.apache.avalon.framework.service.Serviceable
      Throws:
      org.apache.avalon.framework.service.ServiceException
      See Also:
      • Serviceable.service(org.apache.avalon.framework.service.ServiceManager)
    • configure

      public void configure(org.apache.avalon.framework.configuration.Configuration configuration) throws org.apache.avalon.framework.configuration.ConfigurationException
      Specified by:
      configure in interface org.apache.avalon.framework.configuration.Configurable
      Throws:
      org.apache.avalon.framework.configuration.ConfigurationException
      See Also:
      • Configurable.configure(org.apache.avalon.framework.configuration.Configuration)
    • parameterize

      public void parameterize(org.apache.avalon.framework.parameters.Parameters parameters) throws org.apache.avalon.framework.parameters.ParameterException
      Specified by:
      parameterize in interface org.apache.avalon.framework.parameters.Parameterizable
      Throws:
      org.apache.avalon.framework.parameters.ParameterException
      See Also:
      • Parameterizable.parameterize(org.apache.avalon.framework.parameters.Parameters)
    • reconfigure

      public void reconfigure(org.apache.avalon.framework.configuration.Configuration configuration) throws org.apache.avalon.framework.configuration.ConfigurationException
      Specified by:
      reconfigure in interface org.apache.avalon.framework.configuration.Reconfigurable
      Throws:
      org.apache.avalon.framework.configuration.ConfigurationException
      See Also:
      • Reconfigurable.reconfigure(org.apache.avalon.framework.configuration.Configuration)
    • dispose

      public void dispose()
      Specified by:
      dispose in interface org.apache.avalon.framework.activity.Disposable
      See Also:
      • Disposable.dispose()
    • toString

      public String toString()
      Overrides:
      toString in class Object
      See Also:
    • hasService

      protected boolean hasService(String key)
      Parameters:
      key - name of the service to test for
      Returns:
      boolean indicator if the service exists
      See Also:
      • ServiceManager.hasService(java.lang.String)
    • lookup

      protected Object lookup(String key)
      Parameters:
      key - name of service to lookup from the service manager
      Returns:
      reference to the service
      See Also:
      • ServiceManager.lookup(java.lang.String)
    • release

      protected void release(Object object)
      Parameters:
      object - service to release
      See Also:
      • ServiceManager.release(java.lang.Object)
    • createAbsoluteFile

      protected File createAbsoluteFile(String fileName)
      Determines the absolute file based on the application directory
      Parameters:
      fileName - the filename
      Returns:
      the absolute file
    • createAbsolutePath

      protected String createAbsolutePath(String fileName)
      Determines the absolute path based on the application directory
      Parameters:
      fileName - the filename
      Returns:
      the absolute path
    • getServiceApplicationDir

      protected File getServiceApplicationDir()
      Returns:
      Returns the serviceApplicationDir.
    • getServiceClassLoader

      protected ClassLoader getServiceClassLoader()
      Returns:
      Returns the serviceClassLoader.
    • getServiceConfiguration

      protected org.apache.avalon.framework.configuration.Configuration getServiceConfiguration()
      Returns:
      Returns the serviceConfiguration.
    • getServiceContext

      protected org.apache.avalon.framework.context.Context getServiceContext()
      Returns:
      Returns the serviceContext.
    • getServiceManager

      protected org.apache.avalon.framework.service.ServiceManager getServiceManager()
      Returns:
      Returns the serviceManager.
    • getServiceName

      protected String getServiceName()
      Returns:
      Returns the serviceName.
    • getServiceParameters

      protected org.apache.avalon.framework.parameters.Parameters getServiceParameters()
      Returns:
      Returns the serviceParameters.
    • getServicePartitionName

      protected String getServicePartitionName()
      Returns:
      Returns the servicePartitionName.
    • getServiceTempDir

      protected File getServiceTempDir()
      Returns:
      Returns the serviceTempDir.