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 ...
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Jesse Duncan
  • Frits Walraven
  • 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
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic