• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • 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: 23923
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
 
To do a great right, do a little wrong - shakepeare. twisted little ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic