jmx 0.6 → 0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,6 +6,7 @@ lib/jmx
6
6
  lib/jmx.rb
7
7
  lib/rmi.rb
8
8
  lib/jmx/dynamic_mbean.rb
9
+ lib/jmx/notifier.rb
9
10
  lib/jmx/server.rb
10
11
  lib/jmx/version.rb
11
12
  samples/memory.rb
data/lib/jmx.rb CHANGED
@@ -151,12 +151,6 @@ module JMX
151
151
  @server.removeNotificationListener @object_name, listener
152
152
  end
153
153
 
154
- def method_missing(name, *args)
155
- puts "Invoking: #{name}, #{args}"
156
- java_args = java_args(args)
157
- @server.invoke @object_name, name.to_s, java_args, java_types(java_args)
158
- end
159
-
160
154
  private
161
155
 
162
156
  # Define ruby friendly methods for attributes. For odd attribute names or names
@@ -0,0 +1,31 @@
1
+ module JMX
2
+ module RubyNotificationEmitter
3
+ java_import javax.management.MBeanNotificationInfo
4
+
5
+ include javax.management.NotificationEmitter
6
+
7
+ def listeners
8
+ @listener ||= {}
9
+ end
10
+
11
+ # NotificationListener listener, NotificationFilter filter, Object handback
12
+ def addNotificationListener(listener, filter, handback)
13
+ listeners[listener] = [filter, handback]
14
+ end
15
+
16
+ def getNotificationInfo
17
+ [].to_java MBeanNotificationInfo
18
+ end
19
+
20
+ # NotificationListener listener, NotificationFilter filter, Object handback
21
+ def removeNotificationListener(listener, filter=nil, handback=nil)
22
+ found = false
23
+ listeners.delete_if do |clistener, (cfilter, chandback)|
24
+ v = listener == clistener && filter == cfilter && handback == chandback
25
+ found = true if v
26
+ v
27
+ end
28
+ raise javax.management.ListenerNotFoundException.new unless found
29
+ end
30
+ end
31
+ end
@@ -1,3 +1,3 @@
1
1
  module JMX
2
- VERSION = "0.6"
2
+ VERSION = "0.7"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: jmx
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: "0.6"
5
+ version: "0.7"
6
6
  platform: ruby
7
7
  authors:
8
8
  - Thomas Enebo & Jay McGaffigan
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-03-23 00:00:00 -05:00
13
+ date: 2011-04-12 00:00:00 -05:00
14
14
  default_executable:
15
15
  dependencies: []
16
16
 
@@ -31,6 +31,7 @@ files:
31
31
  - lib/jmx.rb
32
32
  - lib/rmi.rb
33
33
  - lib/jmx/dynamic_mbean.rb
34
+ - lib/jmx/notifier.rb
34
35
  - lib/jmx/server.rb
35
36
  - lib/jmx/version.rb
36
37
  - samples/memory.rb