Package com.luna.common.os.hardware
Class OshiUtils
java.lang.Object
com.luna.common.os.hardware.OshiUtils
- Author:
- Luna
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionacquireMACAddressSet
(oshi.hardware.HardwareAbstractionLayer hal) 获取mac地址static OshiHardware
baseInfo
(oshi.SystemInfo si) static ProcessorDTO
converProcessor
(Processor processor) static JvmDTO
convertJvm
(Jvm jvm) static MemoryDTO
convertMemory
(Memory memory) static SysFileDTO
convertSysFile
(SysFile sysFile) static Processor
cpuInfo
(oshi.hardware.CentralProcessor processor) 设置CPU信息static Long
getRunTime
(DateUnit unit) JDK运行时间static Date
JDK启动时间static Jvm
jvmInfo()
设置Java虚拟机static void
static Memory
memoryInfo
(oshi.hardware.GlobalMemory memory) 设置内存信息static OshiHardwareDTO
oshiHardware2oshiHardwareDTO
(OshiHardware oshiHardware) static void
refresh
(OshiHardware oshiHardware, oshi.SystemInfo si) 刷新系统状态sysFiles
(oshi.software.os.OperatingSystem os) 设置磁盘信息static SystemInfoDTO
sysInfo()
设置服务器信息
-
Constructor Details
-
OshiUtils
public OshiUtils()
-
-
Method Details
-
main
-
refresh
刷新系统状态- Parameters:
oshiHardware
-si
-
-
baseInfo
-
acquireMACAddressSet
获取mac地址可能有多个
- Returns:
-
cpuInfo
设置CPU信息 -
memoryInfo
设置内存信息 -
jvmInfo
设置Java虚拟机 -
getStartTime
JDK启动时间 -
getRunTime
JDK运行时间 -
sysFiles
设置磁盘信息 -
sysInfo
设置服务器信息 -
convertSysFile
-
convertMemory
-
converProcessor
-
convertJvm
-
oshiHardware2oshiHardwareDTO
-