Module: JMX::RubyNotificationEmitter
- Defined in:
- lib/jmx/notifier.rb
Instance Method Summary collapse
-
#addNotificationListener(listener, filter, handback) ⇒ Object
NotificationListener listener, NotificationFilter filter, Object handback.
- #getNotificationInfo ⇒ Object
- #listeners ⇒ Object
-
#removeNotificationListener(listener, filter = nil, handback = nil) ⇒ Object
NotificationListener listener, NotificationFilter filter, Object handback.
Instance Method Details
#addNotificationListener(listener, filter, handback) ⇒ Object
NotificationListener listener, NotificationFilter filter, Object handback
12 13 14 |
# File 'lib/jmx/notifier.rb', line 12 def addNotificationListener(listener, filter, handback) listeners[listener] = [filter, handback] end |
#getNotificationInfo ⇒ Object
16 17 18 |
# File 'lib/jmx/notifier.rb', line 16 def getNotificationInfo [].to_java MBeanNotificationInfo end |
#listeners ⇒ Object
7 8 9 |
# File 'lib/jmx/notifier.rb', line 7 def listeners @listener ||= {} end |
#removeNotificationListener(listener, filter = nil, handback = nil) ⇒ Object
NotificationListener listener, NotificationFilter filter, Object handback
21 22 23 24 25 26 27 28 29 |
# File 'lib/jmx/notifier.rb', line 21 def removeNotificationListener(listener, filter=nil, handback=nil) found = false listeners.delete_if do |clistener, (cfilter, chandback)| v = listener == clistener && filter == cfilter && handback == chandback found = true if v v end raise javax.management.ListenerNotFoundException.new unless found end |