List of usage examples for java.lang.management CompilationMXBean getName
public java.lang.String getName();
From source file:org.fluentd.jvmwatcher.data.JvmWatchState.java
/** * @param clientPrixy//from w w w .j a va 2 s.c om * @return */ public static JvmWatchState makeJvmWatchState(JvmClientProxy clientProxy) { // null check if (null == clientProxy) { return null; } if (null == clientProxy.getLocalJvmInfo()) { return null; } // create data object JvmWatchState ret = new JvmWatchState(); // set Local JVM Information ret.commandLine_ = clientProxy.getLocalJvmInfo().getCommandLine_(); ret.displayName_ = clientProxy.getLocalJvmInfo().getDisplayName(); ret.jvmId_ = clientProxy.getLocalJvmInfo().getJvmid(); ret.shortName_ = clientProxy.getLocalJvmInfo().getShortName(); // create log line array ret.stateLog_ = new ArrayList<JvmStateLog>(); // set JVM information try { // CompilationMXBean CompilationMXBean compilationBean = clientProxy.getCompilationMXBean(); if (null != compilationBean) { ret.jitName_ = compilationBean.getName(); } // OperatingSystemMXBean OperatingSystemMXBean OpeSysBean = clientProxy.getOperatingSystemMXBean(); if (null != OpeSysBean) { ret.osArch_ = OpeSysBean.getArch(); ret.osName_ = OpeSysBean.getName(); ret.osVersion_ = OpeSysBean.getVersion(); } // RuntimeMXBean RuntimeMXBean runtimeBean = clientProxy.getRuntimeMXBean(); if (null != runtimeBean) { ret.jvmStartTime_ = runtimeBean.getStartTime(); ret.jvmRuntimeName_ = runtimeBean.getName(); ret.vmName_ = runtimeBean.getVmName(); ret.vmVender_ = runtimeBean.getVmVendor(); ret.vmVersion_ = runtimeBean.getVmVersion(); ret.specName_ = runtimeBean.getSpecName(); ret.specVender_ = runtimeBean.getSpecVendor(); ret.specVersion_ = runtimeBean.getSpecVersion(); } } catch (IOException ex) { log.error("get MXBean error.", ex); // close JvmClientProxy clientProxy.disconnect(); } catch (Exception ex) { log.error("get MXBean error.", ex); // close JvmClientProxy clientProxy.disconnect(); } return ret; }