Module: JMX::JDKHelper::JDK5

Defined in:
lib/jdk/jdk5.rb

Class Method Summary collapse

Class Method Details

.find_local_url(command_pattern) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/jdk/jdk5.rb', line 13

def find_local_url(command_pattern)
  host_id = HostIdentifier.new(nil)
  host = MonitoredHost.get_monitored_host(host_id)

  host.active_vms.each do |vmid_int|
    vmid = VmIdentifier.new(vmid_int.to_s)
    vm = host.get_monitored_vm(vmid)
    command = MonitoredVmUtil.command_line(vm)
    if command_pattern === command
      return ConnectorAddressLink.import_from(vmid_int)
    end
  end

  nil
end