Interface ApplicationConfigurationManager.ModuleConfigurationHandle
- Enclosing class:
ApplicationConfigurationManager
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 TypeMethodDescriptionvoidChecks if the configuration specifies environment variables that do not match the JVM's environment variables.com.google.apphosting.utils.config.BackendsXmlReturns theBackendsXmlfor this configuration.com.google.apphosting.utils.config.WebModuleReturns theWebModulefor this configuration.voidReads or rereads the configuration from disk to pick up any changes.voidClears {linkSystem.getProperties()values that have been set by this configuration.
-
Method Details
-
getModule
com.google.apphosting.utils.config.WebModule getModule()Returns theWebModulefor 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 giveDevAppServerclients a chance to callDevAppServer.setThrowOnEnvironmentVariableMismatch(boolean)before reporting errors. -
getBackendsXml
com.google.apphosting.utils.config.BackendsXml getBackendsXml()Returns theBackendsXmlfor 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.AppEngineConfigExceptionReads 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:- system properties
- the logging configuration
ApplicationConfigurationManager.ModuleConfigurationHandlefor any other modules. Certain configuration changes are not currently supported including changes that- Adds entries to
ApplicationConfigurationManager.getModuleConfigurationHandles() - removes entries from
ApplicationConfigurationManager.getModuleConfigurationHandles() - Changes the application directory for a
ApplicationConfigurationManager.ModuleConfigurationHandlereturned byApplicationConfigurationManager.getModuleConfigurationHandles()
- Throws:
com.google.apphosting.utils.config.AppEngineConfigException- if the configuration on disk is not valid or includes unsupported changes.
-
restoreSystemProperties
void restoreSystemProperties()Clears {linkSystem.getProperties()values that have been set by this configuration.
-