It's not a secret anymore!
The moose likes Other JSE/JEE APIs and the fly likes How to monitor dynamic values in JMX !! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "How to monitor dynamic values in JMX !!" Watch "How to monitor dynamic values in JMX !!" New topic

How to monitor dynamic values in JMX !!

samir ware
Ranch Hand

Joined: Jul 27, 2005
Posts: 192
Hello Ranchers,
I am trying to monitor number of user sessions through the JMX . I am using jconsole as UI. I have created a variable named 'numberOfUser" in my Monitor class(which is MBean implementation class) and I am updating this variable with each subsequent user login. I have printed the updated value on console and it worked fine. However I am not getting how should I monitor this changing value through jconsole. My requirement is I should be able to see the updated values of "numberOfUser" on jconsole with each user login. f Can anyone please let me know how can I achieve the same
Henry Wong

Joined: Sep 28, 2004
Posts: 20517

*** clarification, I am not a JConsole user, so don't know if this will work for JConsole ***

The standard way for any JMX listener (like JConsole) to get attributes, in a asynchronous manner -- is through the use of JMX notifications. Just have your MBean send an attribute change notification to it's listeners.


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
I agree. Here's the link:
subject: How to monitor dynamic values in JMX !!
It's not a secret anymore!