Class: JMX::MBeanServerConnector
- Inherits:
-
Object
- Object
- JMX::MBeanServerConnector
- Defined in:
- lib/jmx/server.rb
Instance Method Summary collapse
- #active? ⇒ Boolean
-
#initialize(location, server) ⇒ MBeanServerConnector
constructor
A new instance of MBeanServerConnector.
- #start ⇒ Object
- #stop ⇒ Object
Constructor Details
#initialize(location, server) ⇒ MBeanServerConnector
Returns a new instance of MBeanServerConnector.
97 98 99 100 101 102 103 104 105 106 |
# File 'lib/jmx/server.rb', line 97 def initialize(location, server) @url = JMXServiceURL.new location @server = JMXConnectorServerFactory.newJMXConnectorServer @url, nil, server.server if block_given? start yield stop end end |
Instance Method Details
#active? ⇒ Boolean
108 109 110 |
# File 'lib/jmx/server.rb', line 108 def active? @server.isActive end |
#start ⇒ Object
112 113 114 115 |
# File 'lib/jmx/server.rb', line 112 def start @server.start self end |
#stop ⇒ Object
117 118 119 |
# File 'lib/jmx/server.rb', line 117 def stop @server.stop if active? end |