Method: JMX.simple_server

Defined in:
lib/jmx.rb

.simple_server(opts = {}) ⇒ Object

sad little simple server setup so you can connect up to it.



36
37
38
39
40
41
42
43
# File 'lib/jmx.rb', line 36

def self.simple_server(opts = {})
  port = opts[:port] || 8686
  url_path = opts[:url_path] || "/jmxrmi"
  server = opts[:server] || JMX::MBeanServer.new
  url = "service:jmx:rmi:///jndi/rmi://localhost:#{port}#{url_path}"
  $registry = opts[:registry] || RMIRegistry.new(port)
  @connector = JMX::MBeanServerConnector.new(url, JMX::MBeanServer.new).start
end