Class AppConstants

All Implemented Interfaces:
Serializable, Cloneable, Map<Object,Object>

public final class AppConstants extends PropertyLoader
Singleton class that has the constant values for this application.

When an instance is created, it tries to load the properties file specified by the propertiesFileName field

If a property exits with the name ADDITIONAL.PROPERTIES.FILE that file is loaded also

Version:
2.1
Author:
Niels Meijer
See Also:
  • Field Details

    • APPLICATION_SERVER_TYPE_PROPERTY

      public static final String APPLICATION_SERVER_TYPE_PROPERTY
      See Also:
    • APPLICATION_SERVER_CUSTOMIZATION_PROPERTY

      public static final String APPLICATION_SERVER_CUSTOMIZATION_PROPERTY
      See Also:
    • ADDITIONAL_PROPERTIES_FILE_SUFFIX_KEY

      public static final String ADDITIONAL_PROPERTIES_FILE_SUFFIX_KEY
      See Also:
  • Method Details

    • getInstance

      public static AppConstants getInstance()
      Return the AppConstants root instance
      Returns:
      AppConstants instance
    • getInstance

      public static AppConstants getInstance(ClassLoader classLoader)
      Retrieve an instance based on a ClassLoader. This should be used by classes which are part of the Ibis configuration (like pipes and senders) because the configuration might be loaded from outside the webapp classpath. Hence, the Thread.currentThread().getContextClassLoader() at the time the class was instantiated should be used.
      Parameters:
      classLoader - ClassLoader to retrieve AppConstants from
      Returns:
      AppConstants instance
    • removeInstance

      public static void removeInstance()
    • removeInstance

      public static void removeInstance(ClassLoader cl)
    • getTokenizedProperty

      @Deprecated public StringTokenizer getTokenizedProperty(String key, @Nonnull String defaults)
      Deprecated.
      Creates a tokenizer from the resolved value of this key. As a separator the "," is used. Uses the PropertyLoader.getResolvedProperty(String) method. Can be used to process lists of values.
    • getAppConstants

      public Properties getAppConstants(String keyBase)
      Returns a list of AppConstants which names begin with the keyBase
    • getAppConstants

      public Properties getAppConstants(String keyBase, boolean useSystemProperties, boolean useEnvironmentVariables)
      Returns a list of AppConstants which names begin with the keyBase
    • setProperty

      public Object setProperty(String key, String value)
      Add property to global AppConstants
      Overrides:
      setProperty in class Properties
    • setProperty

      public Object setProperty(String key, boolean value)
    • put

      public void put(String key, String value)
      Add property to global (all) AppConstants
    • load

      protected void load(ClassLoader classLoader, String filename)
      Overrides:
      load in class PropertyLoader