MBeanException, ReflectionException, NullPointerException {
if (status != ManagedProcessStatus.RUNNING) {
throw new IllegalStateException("Cannot stop process in state - "
+ status.toString());
}
IHeartbeat heartbeat = getHeartbeat(millis);
if (heartbeat == null) {
return ManagedProcessStatus.UNKNOWN;
}
JMXServiceURL url = new JMXServiceURL(heartbeat.getManagementUrl());
JMXConnector connector = null;
try {
connector = JMXConnectorFactory.connect(url);
connector.getMBeanServerConnection().invoke(
new ObjectName("launcher", "id", "bean"), "shutdown",