public class Systemd extends Object
This object provides getters which instantiate the appropriate
platform-specific implementations of OperatingSystem
(software) and HardwareLayer (hardware).
| Constructor and Description |
|---|
Systemd() |
| Modifier and Type | Method and Description |
|---|---|
static void |
append(StringBuilder builder,
String caption,
Object value)
输出到
StringBuilder |
static void |
dumpSystemInfo()
将系统信息输出到
System.out中 |
static void |
dumpSystemInfo(PrintWriter out)
将系统信息输出到指定
PrintWriter中 |
static String |
get(String key)
获得System属性(调用System.getProperty)
|
static String |
get(String name,
boolean quiet)
取得系统属性,如果因为Java安全的限制而失败,则将错误打在Log中,然后返回
null |
static String |
get(String name,
String defaultValue)
取得系统属性,如果因为Java安全的限制而失败,则将错误打在Log中,然后返回
null |
static boolean |
getBoolean(String key,
boolean defaultValue)
获得boolean类型值
|
static ClassLoadingMXBean |
getClassLoadingMXBean()
返回Java虚拟机类加载系统相关属性
|
static CompilationMXBean |
getCompilationMXBean()
返回Java虚拟机编译系统相关属性
如果没有编译系统,则返回
null |
static long |
getCurrentPID()
获取当前进程 PID
|
static Platform.OS |
getCurrentPlatform()
Getter for the field
currentPlatformEnum. |
static List<GarbageCollectorMXBean> |
getGarbageCollectorMXBeans()
Returns a list of
GarbageCollectorMXBean objects in the Java virtual machine. |
HardwareLayer |
getHardware()
Creates a new instance of the appropriate platform-specific
HardwareLayer. |
static NetworkParams |
getHostInfo()
取得Host的信息
|
static long |
getInt(String key,
int defaultValue)
获得int类型值
|
static JavaInfo |
getJavaInfo()
取得Java Implementation的信息
|
static JavaRuntime |
getJavaRuntimeInfo()
取得当前运行的JRE的信息
|
static JavaSpecInfo |
getJavaSpecInfo()
取得Java Specification的信息
|
static JvmInfo |
getJvmInfo()
取得Java Virtual Machine Implementation的信息
|
static JvmSpecInfo |
getJvmSpecInfo()
取得Java Virtual Machine Specification的信息
|
static InetAddress |
getLocalAddress()
取得当前主机信息
|
static long |
getLong(String key,
long defaultValue)
获得long类型值
|
static List<MemoryManagerMXBean> |
getMemoryManagerMXBeans()
Returns a list of
MemoryManagerMXBean objects in the Java virtual machine. |
static MemoryMXBean |
getMemoryMXBean()
返回Java虚拟机内存系统相关属性
|
static List<MemoryPoolMXBean> |
getMemoryPoolMXBeans()
Returns a list of
MemoryPoolMXBean objects in the Java virtual machine. |
OperatingSystem |
getOperatingSystem()
Creates a new instance of the appropriate platform-specific
OperatingSystem. |
static OperatingSystemMXBean |
getOperatingSystemMXBean()
返回Java虚拟机运行下的操作系统相关信息属性
|
static OperatingSystem |
getOsInfo()
取得OS的信息
|
static RuntimeMXBean |
getRuntimeMXBean()
返回Java虚拟机运行时系统相关属性
|
static ThreadMXBean |
getThreadMXBean()
返回Java虚拟机线程系统相关属性
|
static OSUser |
getUserInfo()
取得User的信息
|
static Properties |
props() |
public static Platform.OS getCurrentPlatform()
Getter for the field currentPlatformEnum.
public static String get(String name, String defaultValue)
nullname - 属性名defaultValue - 默认值nullpublic static String get(String name, boolean quiet)
nullname - 属性名quiet - 安静模式,不将出错信息打在System.err中nullpublic static String get(String key)
key - 键public static boolean getBoolean(String key, boolean defaultValue)
key - 键defaultValue - 默认值public static long getInt(String key, int defaultValue)
key - 键defaultValue - 默认值public static long getLong(String key, long defaultValue)
key - 键defaultValue - 默认值public static Properties props()
public static long getCurrentPID()
public static ClassLoadingMXBean getClassLoadingMXBean()
ClassLoadingMXBeanpublic static MemoryMXBean getMemoryMXBean()
MemoryMXBeanpublic static ThreadMXBean getThreadMXBean()
ThreadMXBeanpublic static RuntimeMXBean getRuntimeMXBean()
RuntimeMXBeanpublic static CompilationMXBean getCompilationMXBean()
nullCompilationMXBean ,如果没有编译系统,则返回nullpublic static OperatingSystemMXBean getOperatingSystemMXBean()
OperatingSystemMXBeanpublic static List<MemoryPoolMXBean> getMemoryPoolMXBeans()
MemoryPoolMXBean objects in the Java virtual machine. The Java virtual machine can have first or more memory pools. It may add or remove memory pools during execution.public static List<MemoryManagerMXBean> getMemoryManagerMXBeans()
MemoryManagerMXBean objects in the Java virtual machine. The Java virtual machine can have first or more memory managers. It may add or remove memory managers during
execution.public static List<GarbageCollectorMXBean> getGarbageCollectorMXBeans()
GarbageCollectorMXBean objects in the Java virtual machine. The Java virtual machine may have first or more GarbageCollectorMXBean objects. It may add or remove
GarbageCollectorMXBean during execution.public static JvmSpecInfo getJvmSpecInfo()
JvmSpecInfo对象public static JvmInfo getJvmInfo()
JvmInfo对象public static JavaSpecInfo getJavaSpecInfo()
JavaSpecInfo对象public static JavaInfo getJavaInfo()
JavaInfo对象public static JavaRuntime getJavaRuntimeInfo()
JreInfo对象public static OperatingSystem getOsInfo()
OsInfo对象public static OSUser getUserInfo()
UserInfo对象public static NetworkParams getHostInfo()
HostInfo对象public static void dumpSystemInfo()
System.out中public static void dumpSystemInfo(PrintWriter out)
PrintWriter中out - PrintWriter输出流public static void append(StringBuilder builder, String caption, Object value)
StringBuilderbuilder - StringBuilder对象caption - 标题value - 值public static InetAddress getLocalAddress()
public OperatingSystem getOperatingSystem()
OperatingSystem.OperatingSystem.public HardwareLayer getHardware()
HardwareLayer.HardwareLayer.Copyright © 2020. All rights reserved.