本文整理汇总了Java中sun.jvmstat.monitor.event.VmStatusChangeEvent类的典型用法代码示例。如果您正苦于以下问题:Java VmStatusChangeEvent类的具体用法?Java VmStatusChangeEvent怎么用?Java VmStatusChangeEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VmStatusChangeEvent类属于sun.jvmstat.monitor.event包,在下文中一共展示了VmStatusChangeEvent类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: vmStatusChanged
import sun.jvmstat.monitor.event.VmStatusChangeEvent; //导入依赖的package包/类
public void vmStatusChanged(VmStatusChangeEvent event) {
try {
for (Object pid : event.getStarted()) {
String vmId = "//" + pid.toString() + "?mode=r";
VmIdentifier id = new VmIdentifier(vmId);
MonitoredVm vm = host.getMonitoredVm(id, 0);
if (predicate.test(new ImmutablePair<>(MonitoredVmUtil.mainClass(vm, true),
MonitoredVmUtil.commandLine(vm))))
try {
log.info(String.format("Attaching to %s %s", MonitoredVmUtil.mainClass(vm, true),
MonitoredVmUtil.commandLine(vm)));
actionsInProgress.incrementAndGet();
actionsSucceeding.addAndGet(action.apply((Integer) pid) ? 1 : 0);
} finally {
actionsInProgress.decrementAndGet();
}
}
} catch (MonitorException | URISyntaxException e) {
actionsInProgress.set(0);
throw new RuntimeException(e);
}
}
示例2: vmStatusChanged
import sun.jvmstat.monitor.event.VmStatusChangeEvent; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public void vmStatusChanged(VmStatusChangeEvent event) {
releaseStarted(event.getStarted());
releaseTerminated(event.getTerminated());
printStatus();
}
示例3: vmStatusChanged
import sun.jvmstat.monitor.event.VmStatusChangeEvent; //导入依赖的package包/类
public void vmStatusChanged(VmStatusChangeEvent ev) {
Integer lvmid = new Integer(vmId.getLocalVmId());
if (ev.getTerminated().contains(lvmid)) {
logger.stopLogging();
} else if (!ev.getActive().contains(lvmid)) {
logger.stopLogging();
}
}