import sun.jvmstat.monitor.MonitoredHost;
import sun.jvmstat.monitor.MonitoredVm;
import sun.jvmstat.monitor.MonitoredVmUtil;
import sun.jvmstat.monitor.VmIdentifier;
public class Test {
public static void main(String[] args) throws Exception {
MonitoredHost host = MonitoredHost.getMonitoredHost((String)null);
for (Object obj : host.activeVms()) {
VmIdentifier vid = new VmIdentifier(obj.toString());
MonitoredVm vm = host.getMonitoredVm(vid);
System.out.println("--------------------------------------------");
System.out.println("PID=" + obj);
System.out.println(MonitoredVmUtil.commandLine(vm));
System.out.println(MonitoredVmUtil.jvmArgs(vm));
System.out.println(MonitoredVmUtil.jvmFlags(vm));
System.out.println(MonitoredVmUtil.mainArgs(vm));
System.out.println(MonitoredVmUtil.mainClass(vm, true));
System.out.println(MonitoredVmUtil.vmVersion(vm));
System.out.println();
}
}
}
|