01: package tide.jmx;
02:
03: import java.lang.management.ManagementFactory;
04: import javax.management.*;
05:
06: /** controls tide from a jConsole
07: */
08: public final class TideControl implements TideControlMBean {
09: public TideControl() {
10: }
11:
12: public void shutdownJVM() {
13: System.exit(0);
14: }
15:
16: /* Call this to enable this Control bean in the managment console.
17: */
18: public static void _installJMXControlService() throws Exception {
19: MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
20:
21: ObjectName name = new ObjectName("tide.jmx:type=TideControl");
22:
23: TideControl mbean = new TideControl();
24:
25: mbs.registerMBean(mbean, name);
26: System.out
27: .println("JMX MBean registered under tide.jmx.TideControl");
28: }
29:
30: }
|