Samples JDK
Server.java
1 package com.freemindcafe.jmx.sample1.server;
2 
3 import java.lang.management.ManagementFactory;
4 
5 import javax.management.MBeanServer;
6 import javax.management.ObjectName;
7 
8 public class Server {
9 
10  public static void main(String[] args)
11  throws Exception {
12 
13  MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
14 
15  ObjectName mbeanName = new ObjectName("com.eMeter.localhost.appName.appInstance:name=EIP.IHelloService");
16  HelloService helloService = new HelloService();
17  mBeanServer.registerMBean(helloService, mbeanName);
18 
19  System.out.println("Waiting forever...");
20  Thread.sleep(Long.MAX_VALUE);
21  }
22 
23 }