java怎么获取硬件信息
java怎么获取硬件信息
你们知道电脑的硬件信息怎么获取吗,下面是学习啦小编带来java怎么获取硬件信息的内容,欢迎阅读!
java怎么获取硬件信息?
IMonitorService接口:
public interface IMonitorService {
public MonitorInfoBean getMonitorInfoBean() throws Exception;
}
MonitorInfoBean类:
/*采集系统存取数据JavaBean*/
public class MonitorInfoBean implements Comparable<MonitorInfoBean> {
/** 操作系统. */
private String osName;
/** 总的物理内存. */
private float totalMemorySize;
/** 已使用的物理内存. */
private float usedMemory;
/** cpu使用率. */
private double cpuRatio;
/** 主机IP地址 */
private String mIpAddress;
/** 数据存储时间 */
private String dDateTime;
/**内存使用率*/
private float memoryRatio;
/**linux下Buffers内存*/
private float buffersMemory;
/**linux下Cached内存*/
private float cachedMemory;
public float getBuffersMemory() {
return buffersMemory;
}
public float getCachedMemory() {
return cachedMemory;
}
public String getDDateTime() {
return dDateTime;
}
public void setDDateTime(String dateTime) {
dDateTime = dateTime;
}
public String getMIpAddress() {
return mIpAddress;
}
public void setMIpAddress(String ipAddress) {
mIpAddress = ipAddress;
}
public String getOsName() {
return osName;
}