Class EasyConf

java.lang.Object
com.germinus.easyconf.EasyConf

public class EasyConf extends Object
Main class to obtain the configuration of a software component. The main method is getConfiguration which must be given the name of a component.
Author:
jferrer@germinus.com
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static Map
     
    private static final Log
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    getConfiguration(String componentName)
    Get the full configuration of the given component.
    getConfiguration(String companyId, String componentName)
    Get the full configuration of the given component, for the given company.
    static void
    Refresh the configuration of all components KNOWN BUG: this method does not refresh the properties configuration because the underlying library Jakarta Commons Configuration also contains a cache which is not refreshable.
    static void
    refreshComponent(String componentName)
    Refresh the configuration of the given component KNOWN BUG: this method does not refresh the properties configuration because the underlying library Jakarta Commons Configuration also contains a cache which is not refreshable.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • log

      private static final Log log
    • cache

      private static Map cache
  • Constructor Details

    • EasyConf

      private EasyConf()
  • Method Details

    • getConfiguration

      public static ComponentConfiguration getConfiguration(String componentName)
      Get the full configuration of the given component. The configuration will be cached so that next calls will not need to reload the properties or XML files again.
      Parameters:
      componentName - any String which can be used to identified a configuration component.
      Returns:
      a ComponentConf instance
    • getConfiguration

      public static ComponentConfiguration getConfiguration(String companyId, String componentName)
      Get the full configuration of the given component, for the given company. This method should be used when the application is to be deployed in an ASP model where several companies want different configurations for the same running applications The configuration will be cached so that next calls will not need to reload the properties or XML files again.
      Parameters:
      companyId - the identifier of the company whose specific configuration should be read
      componentName - any String which can be used to identified a configuration component.
      Returns:
      a ComponentConf instance
    • refreshComponent

      public static void refreshComponent(String componentName)
      Refresh the configuration of the given component KNOWN BUG: this method does not refresh the properties configuration because the underlying library Jakarta Commons Configuration also contains a cache which is not refreshable. This issue is scheduled to be solved after version 1.0 of such library.
    • refreshAll

      public static void refreshAll()
      Refresh the configuration of all components KNOWN BUG: this method does not refresh the properties configuration because the underlying library Jakarta Commons Configuration also contains a cache which is not refreshable. This issue is scheduled to be solved after version 1.0 of such library.