*/
@Override
public void execute(AdminCommandContext context) {
final ActionReport report = context.getActionReport();
SystemPropertyBag spb;
Property domainProp = domain.getProperty("administrative.domain.name");
String domainName = domainProp.getValue();
if ("domain".equals(target) || target.equals(domainName)) {
spb = domain;
} else {
spb = domain.getConfigNamed(target);
if (spb == null) {
spb = domain.getClusterNamed(target);
}
if (spb == null) {
spb = domain.getServerNamed(target);
}
}
if (spb == null) {
report.setActionExitCode(ActionReport.ExitCode.FAILURE);
String msg = localStrings.getLocalString("invalid.target.sys.props",
"Invalid target:{0}. Valid targets types are domain, config, cluster, default server, clustered instance, stand alone instance", target);
report.setMessage(msg);
return;
}
String sysPropName = "";
try {
for (final Object key : properties.keySet()) {
final String propName = (String) key;
sysPropName = propName;
// skip create-system property requests that do not change the
// value of an existing property
if (spb.containsProperty(sysPropName) &&
spb.getSystemProperty(sysPropName).getValue().equals(properties.getProperty(propName))) {
continue;
}
ConfigSupport.apply(new SingleConfigCode<SystemPropertyBag>() {
@Override