Klasse ServiceContainerConfiguration

java.lang.Object
org.apache.fulcrum.yaafi.framework.factory.ServiceContainerConfiguration

public class ServiceContainerConfiguration extends Object
Helper class to capture configuration related stuff. The are two ways for setting up the configuration:
  • set all parameters manually
  • use a containerConfiguration file and provide the remaining settings
The Avalon context and configuration are created by
  • createFinalContext()
  • createFinalConfiguration()
Autor:
Siegfried Goeschl
  • Konstruktordetails

    • ServiceContainerConfiguration

      public ServiceContainerConfiguration()
      Constructor
    • ServiceContainerConfiguration

      public ServiceContainerConfiguration(int logLevel)
      Constructor.
      Parameter:
      logLevel - the log level for the console logger.
  • Methodendetails

    • addToContext

      public void addToContext(String name, Object value)
      Add a new entry to the context by creating a new one.
      Parameter:
      name - the name of the new entry
      value - the value of the new entry
    • addToContext

      public void addToContext(Hashtable<?,?> hashtable)
      Add a hashtable to the context
      Parameter:
      hashtable - the Hashtable to be added
    • createFinalContext

      public org.apache.avalon.framework.context.Context createFinalContext() throws IOException, Exception
      Create the final Avalon context passed to YAAFI containing
      • user-supplied context
      • urn:avalon:home
      • urn:avalon:temp
      • urn:avalon:name
      • urn:avalon:partition
      • urn:avalon:classloader
      Gibt zurück:
      the final Context
      Löst aus:
      Exception - if filename not defined
      IOException - if file not found
    • createFinalConfiguration

      public org.apache.avalon.framework.configuration.Configuration createFinalConfiguration()
      Create a final configuration.
      Gibt zurück:
      the configuration
    • setComponentConfigurationLocation

      public void setComponentConfigurationLocation(String componentConfigurationLocation)
      Parameter:
      componentConfigurationLocation - The componentConfigurationLocation to set.
    • setComponentRolesLocation

      public void setComponentRolesLocation(String componentRolesLocation)
      Parameter:
      componentRolesLocation - The componentRolesLocation to set.
    • setContext

      public void setContext(org.apache.avalon.framework.context.Context context)
      Parameter:
      context - The context to set.
    • setComponentConfigurationEncrypted

      public void setComponentConfigurationEncrypted(String isComponentConfigurationEncrypted)
      Parameter:
      isComponentConfigurationEncrypted - The isComponentConfigurationEncrypted to set.
    • setComponentRolesEncrypted

      public void setComponentRolesEncrypted(String isComponentRolesEncrypted)
      Parameter:
      isComponentRolesEncrypted - The isComponentRolesEncrypted to set.
    • setParametersEncrypted

      public void setParametersEncrypted(String isParametersEncrypted)
      Parameter:
      isParametersEncrypted - The isParametersEncrypted to set.
    • getLogger

      public org.apache.avalon.framework.logger.Logger getLogger()
      Gibt zurück:
      Returns the logger.
    • setLogger

      public void setLogger(org.apache.avalon.framework.logger.Logger logger)
      Parameter:
      logger - The logger to set.
    • setParametersLocation

      public void setParametersLocation(String parametersLocation)
      Parameter:
      parametersLocation - The parametersLocation to set.
    • setApplicationRootDir

      public void setApplicationRootDir(String applicationRootDir)
      Parameter:
      applicationRootDir - The applicationRootDir to set.
    • setTempRootDir

      public void setTempRootDir(String tempRootDir)
      Parameter:
      tempRootDir - The tempRootDir to set.
    • setComponentClassLoader

      public void setComponentClassLoader(ClassLoader componentClassLoader)
      Parameter:
      componentClassLoader - The classLoader to set.
    • setContainerFlavour

      public void setContainerFlavour(String containerFlavour)
      Parameter:
      containerFlavour - The containerFlavour to set.
    • setContainerConfiguration

      public void setContainerConfiguration(org.apache.avalon.framework.configuration.Configuration containerConfiguration)
      Parameter:
      containerConfiguration - The containerConfiguration to set.
    • getParentServiceManager

      public org.apache.avalon.framework.service.ServiceManager getParentServiceManager()
      Get the parent service manager to find service managed by the parent container.
      Gibt zurück:
      the parent container
    • setParentServiceManager

      public void setParentServiceManager(org.apache.avalon.framework.service.ServiceManager parentServiceManager)
      Set the parent service manager to find service managed by the parent container.
      Parameter:
      parentServiceManager - the parent container
    • getServiceManagerList

      public String[] getServiceManagerList()
      Get a list of service manager managing their own set of services.
      Gibt zurück:
      a list of service implementing the ServiceManager interface
    • setServiceManagerList

      public void setServiceManagerList(String[] serviceManagerList)
      Set a list of service manager managing their own set of services.
      Parameter:
      serviceManagerList - a list of service implementing the ServiceManager interface
    • hasServiceManagerList

      public boolean hasServiceManagerList()
      Gibt zurück:
      true if there is a service manager defined
    • loadContainerConfiguration

      public void loadContainerConfiguration(String location) throws IOException
      Loads a containerConfiguration file and set is as the Avalon configuration to be used for Configurable.configure(). Take care that the implementation uses an InputStreamLocator to find the containerConfiguration which uses the previously set application root directory.
      Parameter:
      location - the location of the containerConfiguration
      Löst aus:
      IOException - loading the configuration failed
    • loadContainerConfiguration

      public void loadContainerConfiguration(String location, String isEncrypted) throws IOException
      Loads a containerConfiguration file and set is as the Avalon configuration to be used for Configurable.configure(). Take care that the implementation uses an InputStreamLocator to find the containerConfiguration which uses the previously set application root directory.
      Parameter:
      location - the location of the containerConfiguration
      isEncrypted - is the file encrypted
      Löst aus:
      IOException - loading the configuration failed