Interface ApplicationConfigurationManager.ModuleConfigurationHandle

Enclosing class:
ApplicationConfigurationManager

public static interface ApplicationConfigurationManager.ModuleConfigurationHandle
Handle for accessing and rereading a module configuration.

A WAR configuration supports a single module with additional backends specified in war/WEB-INF/backends.xml. All instances of the single module and all backends instances share a single ApplicationConfigurationManager.ModuleConfigurationHandle so updates made by a call to readConfiguration() will be visible to all module and backend instances. An EAR configuration supports multiple modules. All instances of a module share a single ApplicationConfigurationManager.ModuleConfigurationHandle so updates made by a call to readConfiguration() for a particular module are visible to all instances of the module.

To control when changes become visible clients should keep and refresh references to values which will be replaced when the configuration is reread including getModule() and for WAR configurations getBackendsXml().

Implementations synchronize operations that read or write state that may be changed by readConfiguration() on ApplicationConfigurationManager.this. Note that configuration updates involving edits to multiple configuration files are not guaranteed to be atomic in the case readConfiguration() is called after one write and before another during a multi-write configuration change. Given this and that backends are about to be deprecated, no synchronized operation is provided for a client to obtain the combined values returned by calling getModule() and then calling getBackendsXml().

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Checks if the configuration specifies environment variables that do not match the JVM's environment variables.
    com.google.apphosting.utils.config.BackendsXml
    Returns the BackendsXml for this configuration.
    com.google.apphosting.utils.config.WebModule
    Returns the WebModule for this configuration.
    void
    Reads or rereads the configuration from disk to pick up any changes.
    void
    Clears {link System.getProperties() values that have been set by this configuration.
  • Method Details

    • getModule

      com.google.apphosting.utils.config.WebModule getModule()
      Returns the WebModule for this configuration.
    • checkEnvironmentVariables

      void checkEnvironmentVariables()
      Checks if the configuration specifies environment variables that do not match the JVM's environment variables.

      This check is broken out rather than implemented during construction for backwards compatibility. The check is deferred until DevAppServer.start() to give DevAppServer clients a chance to call DevAppServer.setThrowOnEnvironmentVariableMismatch(boolean) before reporting errors.

    • getBackendsXml

      com.google.apphosting.utils.config.BackendsXml getBackendsXml()
      Returns the BackendsXml for this configuration.

      For EAR configurations this will return null. For WAR configurations this will return a value read from the war/WEB-INF/backends.xml if one is specified or null otherwise.

    • readConfiguration

      void readConfiguration() throws com.google.apphosting.utils.config.AppEngineConfigException
      Reads or rereads the configuration from disk to pick up any changes. Calling this function affects global state visible to all the modules in the application including:
      1. system properties
      2. the logging configuration
      Because for EAR configurations the global state includes information from all the modules in the EAR, this rereads the configuration for every module. This does not update the ApplicationConfigurationManager.ModuleConfigurationHandle for any other modules. Certain configuration changes are not currently supported including changes that
      1. Adds entries to ApplicationConfigurationManager.getModuleConfigurationHandles()
      2. removes entries from ApplicationConfigurationManager.getModuleConfigurationHandles()
      3. Changes the application directory for a ApplicationConfigurationManager.ModuleConfigurationHandle returned by ApplicationConfigurationManager.getModuleConfigurationHandles()
      Throws:
      com.google.apphosting.utils.config.AppEngineConfigException - if the configuration on disk is not valid or includes unsupported changes.
    • restoreSystemProperties

      void restoreSystemProperties()
      Clears {link System.getProperties() values that have been set by this configuration.