Module: JMX::RubyNotificationEmitter

Defined in:
lib/jmx/notifier.rb

Instance Method Summary collapse

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

#getNotificationInfoObject



16
17
18
# File 'lib/jmx/notifier.rb', line 16

def getNotificationInfo
  [].to_java MBeanNotificationInfo
end

#listenersObject



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

Raises:

  • (javax.management.ListenerNotFoundException)


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