equal
deleted
inserted
replaced
77 return excludeClass.getName(); |
77 return excludeClass.getName(); |
78 } |
78 } |
79 |
79 |
80 private static boolean check(VirtualMachineDescriptor vmd, String excludeClass, String partialMatch) { |
80 private static boolean check(VirtualMachineDescriptor vmd, String excludeClass, String partialMatch) { |
81 |
81 |
82 String mainClass = null; |
82 // Try to get the main class name using (platform specific) ProcessHelper |
|
83 String mainClass = ProcessHelper.getMainClass(vmd.id()); |
83 |
84 |
84 // Get the main class name using platform specific helper |
85 // If the main class name could not be retrieved by ProcessHelper, get it with the attach mechanism |
85 ProcessHelper helper = ProcessHelper.platformProcessHelper(); |
|
86 if (helper != null) { |
|
87 mainClass = helper.getMainClass(vmd.id()); |
|
88 } |
|
89 |
|
90 // If the main class name is still unset then retrieve it with the attach mechanism |
|
91 if (mainClass == null) { |
86 if (mainClass == null) { |
92 try { |
87 try { |
93 VmIdentifier vmId = new VmIdentifier(vmd.id()); |
88 VmIdentifier vmId = new VmIdentifier(vmd.id()); |
94 MonitoredHost monitoredHost = MonitoredHost.getMonitoredHost(vmId); |
89 MonitoredHost monitoredHost = MonitoredHost.getMonitoredHost(vmId); |
95 MonitoredVm monitoredVm = monitoredHost.getMonitoredVm(vmId, -1); |
90 MonitoredVm monitoredVm = monitoredHost.getMonitoredVm(vmId, -1); |