public void updated(Dictionary properties) throws ConfigurationException {
if (properties == null)
return;
// Environment
Environment env = null;
String environmentValue = StringUtils.trimToNull((String) properties.get(OPT_ENVIRONMENT));
if (StringUtils.isNotBlank(environmentValue)) {
try {
env = Environment.valueOf(StringUtils.capitalize(environmentValue));
logger.debug("Configured value for the default runtime environment is '{}'", env.toString().toLowerCase());
} catch (IllegalArgumentException e) {
throw new ConfigurationException(OPT_ENVIRONMENT, environmentValue);
}
} else {
env = DEFAULT_ENVIRONMENT;
logger.debug("Using default value '{}' for runtime environment", env.toString().toLowerCase());
}
// Did the setting change?
if (!env.equals(environment)) {
this.environment = env;
if (registration != null) {
try {
registration.unregister();
} catch (IllegalStateException e) {