CommandLine commandLine = this.getCommandLine(args);
String host = commandLine.getOptionValue("host", "127.0.0.1");
int port = Integer.parseInt(commandLine.getOptionValue("port", "9999"));
JMXClient jmxClient = JMXClient.getJMXClient(host, port);
this.println("connected to " + jmxClient.getAddressAsString());
ObjectInstance brokerInstance = jmxClient.queryMBeanForOne(METABROKER_NAME);
if (brokerInstance != null) {
jmxClient.invoke(brokerInstance.getObjectName(), "stop", new Object[0], new String[0]);
jmxClient.close();
this.println("invoke " + brokerInstance.getClassName() + "#stop success");
}
else {
this.println("û���ҵ� " + METABROKER_NAME);
}