Class: JMX::Operation

Inherits:
Struct
  • Object
show all
Includes:
JavaTypeAware
Defined in:
lib/dynamic_mbean.rb

Constant Summary

Constants included from JavaTypeAware

JavaTypeAware::SIMPLE_TYPES

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from JavaTypeAware

#to_java_type, #to_ruby

Constructor Details

#initialize(description) ⇒ Operation

Returns a new instance of Operation.



54
55
56
57
# File 'lib/dynamic_mbean.rb', line 54

def initialize(description)
  super
  self.parameters, self.impact, self.description = [], MBeanOperationInfo::UNKNOWN, description
end

Instance Attribute Details

#descriptionObject

Returns the value of attribute description

Returns:

  • (Object)

    the current value of description



51
52
53
# File 'lib/dynamic_mbean.rb', line 51

def description
  @description
end

#impactObject

Returns the value of attribute impact

Returns:

  • (Object)

    the current value of impact



51
52
53
# File 'lib/dynamic_mbean.rb', line 51

def impact
  @impact
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



51
52
53
# File 'lib/dynamic_mbean.rb', line 51

def name
  @name
end

#parametersObject

Returns the value of attribute parameters

Returns:

  • (Object)

    the current value of parameters



51
52
53
# File 'lib/dynamic_mbean.rb', line 51

def parameters
  @parameters
end

#return_typeObject

Returns the value of attribute return_type

Returns:

  • (Object)

    the current value of return_type



51
52
53
# File 'lib/dynamic_mbean.rb', line 51

def return_type
  @return_type
end

Instance Method Details

#to_jmxObject



59
60
61
62
# File 'lib/dynamic_mbean.rb', line 59

def to_jmx
  java_parameters = parameters.map { |parameter| parameter.to_jmx }
  MBeanOperationInfo.new name.to_s, description, java_parameters.to_java(javax.management.MBeanParameterInfo), to_java_type(return_type), impact
end