28293031323334
public class NodeCpuCollector implements Callable<NodeCpuInfo> { public NodeCpuInfo call() throws Exception { OperatingSystemMXBean osBean = ManagementFactory.getOperatingSystemMXBean(); return new NodeCpuInfo(osBean.getAvailableProcessors()); }