• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java OperatingSystem类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.hyperic.sigar.OperatingSystem的典型用法代码示例。如果您正苦于以下问题:Java OperatingSystem类的具体用法?Java OperatingSystem怎么用?Java OperatingSystem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



OperatingSystem类属于org.hyperic.sigar包,在下文中一共展示了OperatingSystem类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: testGetOSInfo

import org.hyperic.sigar.OperatingSystem; //导入依赖的package包/类
public void testGetOSInfo() {
	OperatingSystem OS = OperatingSystem.getInstance();
	// 操作系统内核类型如: 386、486、586等x86
	System.out.println("OS.getArch() = " + OS.getArch());
	System.out.println("OS.getCpuEndian() = " + OS.getCpuEndian());//
	System.out.println("OS.getDataModel() = " + OS.getDataModel());//
	// 系统描述
	System.out.println("OS.getDescription() = " + OS.getDescription());
	System.out.println("OS.getMachine() = " + OS.getMachine());//
	// 操作系统类型
	System.out.println("OS.getName() = " + OS.getName());
	System.out.println("OS.getPatchLevel() = " + OS.getPatchLevel());//
	// 操作系统的卖主
	System.out.println("OS.getVendor() = " + OS.getVendor());
	// 卖主名称
	System.out.println("OS.getVendorCodeName() = " + OS.getVendorCodeName());
	// 操作系统名称
	System.out.println("OS.getVendorName() = " + OS.getVendorName());
	// 操作系统卖主类型
	System.out.println("OS.getVendorVersion() = " + OS.getVendorVersion());
	// 操作系统的版本号
	System.out.println("OS.getVersion() = " + OS.getVersion());
}
 
开发者ID:funtl,项目名称:framework,代码行数:24,代码来源:SysInfo.java


示例2: getResult

import org.hyperic.sigar.OperatingSystem; //导入依赖的package包/类
public static Map<String, String> getResult() {
	Map<String, String> result = Maps.newHashMap();
	result.put("Current user", System.getProperty("user.name"));
	OperatingSystem sys = OperatingSystem.getInstance();
	result.put("OS description", sys.getDescription());
	result.put("OS name", sys.getName());
	result.put("OS arch", sys.getArch());
	result.put("OS machine", sys.getMachine());
	result.put("OS version", sys.getVersion());
	result.put("OS description", sys.getDescription());
	result.put("OS patch level", sys.getPatchLevel());
	
	result.put("OS vendor", sys.getVendor());
	result.put("OS vendor version", sys.getVendorVersion());
	if (sys.getVendorCodeName() != null) {
		result.put("OS code name", sys.getVendorCodeName());
	}
	result.put("OS data model", sys.getDataModel());
	result.put("OS cpu endian", sys.getCpuEndian());
	result.put("Java vm version", System.getProperty("java.vm.version"));
	result.put("Java vm vendor", System.getProperty("java.vm.vendor"));
	result.put("Java home", System.getProperty("java.home"));
	return result;
}
 
开发者ID:cqyijifu,项目名称:watcher,代码行数:25,代码来源:OsVersionMetircs.java


示例3: getNodeOSInfo

import org.hyperic.sigar.OperatingSystem; //导入依赖的package包/类
/**
 * Method getNodeOSInfo.
 * 
 * @return Map<Object,Object>
 */
public Map<Object, Object> getNodeOSInfo() {
	OperatingSystem os = null;
	Map<Object, Object> nodeOSInfo = new HashMap<Object, Object>();

	os = OperatingSystem.getInstance();

	nodeOSInfo.put("arch", os.getArch());
	nodeOSInfo.put("cpuEndian", os.getCpuEndian());
	nodeOSInfo.put("dataModel", os.getDataModel());
	nodeOSInfo.put("description", os.getDescription());
	nodeOSInfo.put("machineName", os.getMachine());
	nodeOSInfo.put("patchlevel", os.getPatchLevel());
	nodeOSInfo.put("systemVersion", os.getVersion());
	nodeOSInfo.put("vendor", os.getVendor());
	nodeOSInfo.put("vendorCodeName", os.getVendorCodeName());
	nodeOSInfo.put("vendorVersion", os.getVendorVersion());

	return nodeOSInfo;
}
 
开发者ID:Impetus,项目名称:ankush,代码行数:25,代码来源:SigarNodeInfoProvider.java


示例4: printInfo

import org.hyperic.sigar.OperatingSystem; //导入依赖的package包/类
public static void printInfo(PrintStream os) {
    try {
        printNativeInfo(os);
    } catch (UnsatisfiedLinkError e) {
        os.println("*******ERROR******* " + e);
    }

    os.println("Current user........" +
               System.getProperty("user.name"));
    os.println("");
    
    OperatingSystem sys = OperatingSystem.getInstance();
    os.println("OS description......" + sys.getDescription());
    os.println("OS name............." + sys.getName());
    os.println("OS arch............." + sys.getArch());
    os.println("OS machine.........." + sys.getMachine());
    os.println("OS version.........." + sys.getVersion());
    os.println("OS patch level......" + sys.getPatchLevel());
    os.println("OS vendor..........." + sys.getVendor());
    os.println("OS vendor version..." + sys.getVendorVersion());
    if (sys.getVendorCodeName() != null) {
        os.println("OS code name........" + sys.getVendorCodeName());
    }
    os.println("OS data model......." + sys.getDataModel());
    os.println("OS cpu endian......." + sys.getCpuEndian());

    os.println("Java vm version....." + 
               System.getProperty("java.vm.version"));
    os.println("Java vm vendor......" + 
            System.getProperty("java.vm.vendor"));
    os.println("Java home..........." +
            System.getProperty("java.home"));
}
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:34,代码来源:Version.java


示例5: matches

import org.hyperic.sigar.OperatingSystem; //导入依赖的package包/类
@Override 
public boolean matches(final ConditionContext context, final AnnotatedTypeMetadata metadata) {
  return OperatingSystem.IS_WIN32;
}
 
开发者ID:OctoPerf,项目名称:jmx-agent,代码行数:5,代码来源:IsWindows.java


示例6: matches

import org.hyperic.sigar.OperatingSystem; //导入依赖的package包/类
@Override
public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
  return !OperatingSystem.IS_WIN32;
}
 
开发者ID:OctoPerf,项目名称:jmx-agent,代码行数:5,代码来源:IsNotWindows.java


示例7: getOS

import org.hyperic.sigar.OperatingSystem; //导入依赖的package包/类
public static OperatingSystem getOS() throws SigarException {
	_init();

	OperatingSystem os = OperatingSystem.getInstance();

	return os;
}
 
开发者ID:giiwa,项目名称:giiwa,代码行数:8,代码来源:Host.java



注:本文中的org.hyperic.sigar.OperatingSystem类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java RMNodeImpl类代码示例发布时间:2022-05-22
下一篇:
Java FormDef类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap