本文整理汇总了Java中org.hyperic.sigar.SigarLoader.getNativeLibraryName方法的典型用法代码示例。如果您正苦于以下问题:Java SigarLoader.getNativeLibraryName方法的具体用法?Java SigarLoader.getNativeLibraryName怎么用?Java SigarLoader.getNativeLibraryName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.hyperic.sigar.SigarLoader
的用法示例。
在下文中一共展示了SigarLoader.getNativeLibraryName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadSigarIfRunningWithOneJar
import org.hyperic.sigar.SigarLoader; //导入方法依赖的package包/类
private void loadSigarIfRunningWithOneJar() {
if (OneJar.isRunningWithOneJar()) {
String nativeLibraryName = SigarLoader.getNativeLibraryName();
String nativeLibraryNameToLoad = nativeLibraryName.replace(SigarLoader.getLibraryExtension(), "")
.replace(SigarLoader.getLibraryPrefix(), "");
System.loadLibrary(nativeLibraryNameToLoad);
}
}
示例2: printNativeInfo
import org.hyperic.sigar.SigarLoader; //导入方法依赖的package包/类
private static void printNativeInfo(PrintStream os) {
String version =
"java=" + Sigar.VERSION_STRING +
", native=" + Sigar.NATIVE_VERSION_STRING;
String build =
"java=" + Sigar.BUILD_DATE +
", native=" + Sigar.NATIVE_BUILD_DATE;
String scm =
"java=" + Sigar.SCM_REVISION +
", native=" + Sigar.NATIVE_SCM_REVISION;
String archlib =
SigarLoader.getNativeLibraryName();
os.println("Sigar version......." + version);
os.println("Build date.........." + build);
os.println("SCM rev............." + scm);
String host = getHostName();
String fqdn;
Sigar sigar = new Sigar();
try {
File lib = sigar.getNativeLibrary();
if (lib != null) {
archlib = lib.getName();
}
fqdn = sigar.getFQDN();
} catch (SigarException e) {
fqdn = "unknown";
} finally {
sigar.close();
}
os.println("Archlib............." + archlib);
os.println("Current fqdn........" + fqdn);
if (!fqdn.equals(host)) {
os.println("Hostname............" + host);
}
if (SigarLoader.IS_WIN32) {
LocaleInfo info = new LocaleInfo();
os.println("Language............" + info);
os.println("Perflib lang id....." +
info.getPerflibLangId());
}
}