Class: Rumx::JMXBean

Inherits:
Object
  • Object
show all
Includes:
Bean
Defined in:
lib/rumx/jmx_bean.rb

Instance Method Summary collapse

Methods included from Bean

add_root, #bean_add_child, #bean_children, #bean_each, #bean_each_child, #bean_each_child_recursive, #bean_each_embedded_child, #bean_each_operation, #bean_each_operation_recursive, #bean_embedded, #bean_find, #bean_get_and_set_attributes, #bean_get_attributes, #bean_has_operations?, #bean_monitor, #bean_remove_child, #bean_set_and_get_attributes, #bean_set_attributes, #bean_synchronize, find, find_operation, included, remove_root, root

Constructor Details

#initialize(object_name) ⇒ JMXBean

Returns a new instance of JMXBean.



5
6
7
8
9
# File 'lib/rumx/jmx_bean.rb', line 5

def initialize(object_name)
  @name = javax.management.ObjectName.new(object_name)
  @mbean_info = java.lang.management.ManagementFactory.getPlatformMBeanServer.getMBeanInfo(@name)
  raise "Could not find JMX Bean matching #{object_name}" unless @mbean_info
end

Instance Method Details

#bean_has_attributes?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/rumx/jmx_bean.rb', line 11

def bean_has_attributes?
  @mbean_info.getAttributes.size > 0
end