// assume we succeed - we'll set to failure if we can't set all properties
report.setStatus(ConfigurationUpdateStatus.SUCCESS);
try {
JBossWebServerFile jbossWebServerFile = getJBossWebServerFileInstance();
for (String key : report.getConfiguration().getSimpleProperties().keySet()) {
PropertySimple property = report.getConfiguration().getSimple(key);
if (property != null) {
try {
PropertyDefinitionSimple def = configurationDefinition.getPropertyDefinitionSimple(property
.getName());
if (!(ignoreReadOnly && def.isReadOnly())) {
jbossWebServerFile.setPropertyValue(property.getName(), property.getStringValue());
}
} catch (Exception e) {
property.setErrorMessage(ThrowableUtil.getStackAsString(e));
report.setErrorMessage("Failed setting resource configuration. " + e.getMessage());
log.info("Failure setting MBean Resource configuration value for " + key, e);
}
}
}
jbossWebServerFile.saveConfigurationFile();
} catch (Exception e) {
report.setErrorMessage("Failed to save the resource configuration to file. " + e.getMessage());
log.debug("Unable to save mod_cluster configuration file.", e);
}
}