Gaea Times Micro Blog

angsuman

  • 07:20:47 am on December 26, 2009 | # |
    Tags: , ,

    How to develop JMX MBean in 5 minutes

    1. Create a class named say Abc.
    2. To expose it as MBean, create an interface AbcMBean.
    3. Abc should now implement AbcMBean.
    4. Get information with getMethodName() methods
    5. Set information with setMethodName() methods
    6. Register the MBean class separately:
      java.lang.management.ManagementFactory.getPlatformMBeanServer().registerMBean(new ClassName(), new ObjectName(”com.taragana:name=NameofService”));

    That’s it!

     

Leave a Comment

You must be logged in to post a comment.