ManagerClient managerClient)
{
String pattern = args.getArg("-pattern");
if (pattern == null)
throw new ConfigException(L.l(
"-pattern is required for jmx-set command"));
try {
ObjectName.getInstance(pattern);
} catch (MalformedObjectNameException e) {
throw new ConfigException(L.l("invalid pattern `{0}': `{1}'",
pattern,
e.getMessage()));
}
String attribute = args.getArg("-attribute");
if (attribute == null)
throw new ConfigException(L.l(
"-attribute is required for jmx-set command"));
String value = args.getDefaultArg();
if (value == null)
throw new ConfigException(L.l(
"jmx-set requires <value> parameter be specified"));
String result = managerClient.setJmx(pattern, attribute, value);
System.out.println(result);