• Post Reply Bookmark Topic Watch Topic
  • New 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

notification in JMx

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
how to write the notification and listner class for the JMX.

vinayagamoorthi
 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by vinayaga moorthi:
Hi,
how to write the notification and listner class for the JMX.

vinayagamoorthi



JMX notifications is not something that you can learn in a few paragraphs, I would suggest that you pick up a good book on JMX... but I can try...

Your mbean needs to implement the NotificationBroadcaster interface (with JMX 1.2, you could also use the NotificationEmitter interface instead). One of the methods of this interface, is the add listener, which allows you to add a listener. Basically, this method should just add the notification listeners being registered in some container in the mbean.

When your mbean needs to send a notification, it should create a notification object, iterate through the container of listeners, and call the listeners handle notification method. You also need to give the hand back object back, so that the listeners will have some idea of context.

For the mbean, that is all you need to do... well, except maybe decide which notification you want to send, and how to configure it.


On the client side, you need to develop a notification listener, which is basically a class with a single handle listener method. Either get a context to the mbean server directly, or via an mbean server connector, and call the add notification listener method, to register the listener to a particular mbean.

Henry
 
Talk sense to a fool and he calls you foolish. -Euripides A foolish tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic