Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to monitor dynamic values in JMX !!

 
samir ware
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Thanks
Samir
 
Henry Wong
author
Marshal
Pie
Posts: 21196
81
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

*** 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.

Henry
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic