Java by API/java.lang.management/RuntimeMXBean — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
Admin (обсуждение | вклад) м (1 версия) |
(нет различий)
|
Текущая версия на 14:47, 31 мая 2010
Содержание
RuntimeMXBean: getBootClassPath()
import java.lang.management.ManagementFactory;
import java.lang.management.RuntimeMXBean;
import java.util.Date;
public class Main {
public static void main(String args[]) throws Exception {
RuntimeMXBean mx = ManagementFactory.getRuntimeMXBean();
System.out.println(mx.getBootClassPath());
System.out.println(mx.getClassPath());
System.out.println(mx.getInputArguments());
System.out.println(mx.getSystemProperties());
System.out.println(new Date(mx.getStartTime()));
System.out.println(mx.getUptime() + " ms");
}
}
RuntimeMXBean: getClassPath()
import java.lang.management.ManagementFactory;
import java.lang.management.RuntimeMXBean;
import java.util.Date;
public class Main {
public static void main(String args[]) throws Exception {
RuntimeMXBean mx = ManagementFactory.getRuntimeMXBean();
System.out.println(mx.getBootClassPath());
System.out.println(mx.getClassPath());
System.out.println(mx.getInputArguments());
System.out.println(mx.getSystemProperties());
System.out.println(new Date(mx.getStartTime()));
System.out.println(mx.getUptime() + " ms");
}
}
RuntimeMXBean: getInputArguments()
import java.lang.management.ManagementFactory;
import java.lang.management.RuntimeMXBean;
import java.util.Date;
public class Main {
public static void main(String args[]) throws Exception {
RuntimeMXBean mx = ManagementFactory.getRuntimeMXBean();
System.out.println(mx.getBootClassPath());
System.out.println(mx.getClassPath());
System.out.println(mx.getInputArguments());
System.out.println(mx.getSystemProperties());
System.out.println(new Date(mx.getStartTime()));
System.out.println(mx.getUptime() + " ms");
}
}
RuntimeMXBean: getStartTime()
import java.lang.management.ManagementFactory;
import java.lang.management.RuntimeMXBean;
import java.util.Date;
public class Main {
public static void main(String args[]) throws Exception {
RuntimeMXBean mx = ManagementFactory.getRuntimeMXBean();
System.out.println(mx.getBootClassPath());
System.out.println(mx.getClassPath());
System.out.println(mx.getInputArguments());
System.out.println(mx.getSystemProperties());
System.out.println(new Date(mx.getStartTime()));
System.out.println(mx.getUptime() + " ms");
}
}
RuntimeMXBean: getSystemProperties()
import java.lang.management.ManagementFactory;
import java.lang.management.RuntimeMXBean;
import java.util.Date;
public class Main {
public static void main(String args[]) throws Exception {
RuntimeMXBean mx = ManagementFactory.getRuntimeMXBean();
System.out.println(mx.getBootClassPath());
System.out.println(mx.getClassPath());
System.out.println(mx.getInputArguments());
System.out.println(mx.getSystemProperties());
System.out.println(new Date(mx.getStartTime()));
System.out.println(mx.getUptime() + " ms");
}
}
RuntimeMXBean: getUptime()
import java.lang.management.ManagementFactory;
import java.lang.management.RuntimeMXBean;
import java.util.Date;
public class Main {
public static void main(String args[]) throws Exception {
RuntimeMXBean mx = ManagementFactory.getRuntimeMXBean();
System.out.println(mx.getBootClassPath());
System.out.println(mx.getClassPath());
System.out.println(mx.getInputArguments());
System.out.println(mx.getSystemProperties());
System.out.println(new Date(mx.getStartTime()));
System.out.println(mx.getUptime() + " ms");
}
}