((DistributedWorkManager) wm).setDistributedStatisticsEnabled(resolvedValue.asBoolean()); } else { wm.setStatisticsEnabled(resolvedValue.asBoolean()); wm.setStatisticsEnabled(resolvedValue.asBoolean()); break;
@Override public void start(StartContext context) throws StartException { synchronized (this) { WorkManager wm = workManager.getValue(); wm.setStatisticsEnabled(statsEnabled); if (wm.getStatistics() != null) { PathElement peLocaldWm = PathElement.pathElement(Constants.STATISTICS_NAME, "local"); ResourceBuilder resourceBuilder = ResourceBuilder.Factory.create(peLocaldWm, new StandardResourceDescriptionResolver(Constants.STATISTICS_NAME + "." + Constants.WORKMANAGER_NAME, CommonAttributes.RESOURCE_NAME, CommonAttributes.class.getClassLoader())); ManagementResourceRegistration wmSubRegistration = overrideRegistration.registerSubModel(resourceBuilder.build()); OperationStepHandler metricHandler = new WorkManagerRuntimeAttributeReadHandler(wm, wm.getStatistics(), false); for (SimpleAttributeDefinition metric : Constants.WORKMANAGER_METRICS) { wmSubRegistration.registerMetric(metric, metricHandler); } OperationStepHandler readHandler = new WorkManagerRuntimeAttributeReadHandler(wm, wm.getStatistics(), false); OperationStepHandler writeHandler = new WorkManagerRuntimeAttributeWriteHandler(wm, false, Constants.WORKMANAGER_RW_ATTRIBUTES); for (SimpleAttributeDefinition attribute : Constants.WORKMANAGER_RW_ATTRIBUTES) { wmSubRegistration.registerReadWriteAttribute(attribute, readHandler, writeHandler); } wmSubRegistration.registerOperationHandler(ClearWorkManagerStatisticsHandler.DEFINITION, new ClearWorkManagerStatisticsHandler(wm)); } } }
((DistributedWorkManager) wm).setDistributedStatisticsEnabled(resolvedValue.asBoolean()); } else { wm.setStatisticsEnabled(resolvedValue.asBoolean()); wm.setStatisticsEnabled(resolvedValue.asBoolean()); break;
@Override public void start(StartContext context) throws StartException { synchronized (this) { WorkManager wm = workManager.getValue(); wm.setStatisticsEnabled(statsEnabled); if (wm.getStatistics() != null) { PathElement peLocaldWm = PathElement.pathElement(Constants.STATISTICS_NAME, "local"); ResourceBuilder resourceBuilder = ResourceBuilder.Factory.create(peLocaldWm, new StandardResourceDescriptionResolver(Constants.STATISTICS_NAME + "." + Constants.WORKMANAGER_NAME, CommonAttributes.RESOURCE_NAME, CommonAttributes.class.getClassLoader())); ManagementResourceRegistration wmSubRegistration = overrideRegistration.registerSubModel(resourceBuilder.build()); OperationStepHandler metricHandler = new WorkManagerRuntimeAttributeReadHandler(wm, wm.getStatistics(), false); for (SimpleAttributeDefinition metric : Constants.WORKMANAGER_METRICS) { wmSubRegistration.registerMetric(metric, metricHandler); } OperationStepHandler readHandler = new WorkManagerRuntimeAttributeReadHandler(wm, wm.getStatistics(), false); OperationStepHandler writeHandler = new WorkManagerRuntimeAttributeWriteHandler(wm, false, Constants.WORKMANAGER_RW_ATTRIBUTES); for (SimpleAttributeDefinition attribute : Constants.WORKMANAGER_RW_ATTRIBUTES) { wmSubRegistration.registerReadWriteAttribute(attribute, readHandler, writeHandler); } wmSubRegistration.registerOperationHandler(ClearWorkManagerStatisticsHandler.DEFINITION, new ClearWorkManagerStatisticsHandler(wm)); } } }