Bookmark Topic Watch Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
This is a simple application that can be monitored using JMX. In addition to the parameters that the JVM makes available for monitoring, it creates two MBean objects of its own.

The application consists of 3 classes: the HelloMBean interface to declare what operations and properties the custom MBeans make available, the Hello class that implements the interface -this is the object that can be monitored-, and the HelloAgent application that ties it all together.





After starting the application with



run the JMX console via "jconsole" from the command line. In the MBeans tab you'll see the hello1 and hello2 objects. Their "message" property can be manipulated independently, and the change count is updated accordingly. The application will quit automatically after 5 minutes.

Instead of jconsole you can also use VisualVM (which ships with the JDK) if you install its MBeans plugin.




CategoryCodeSamples CodeBarn
    Bookmark Topic Watch Topic
  • New Topic