@Override public void execute(OperationContext operationContext, ModelNode modelNode) throws OperationFailedException { secondRuntimeStep(context, operation, context.getResourceRegistrationForUpdate(), model, isXa()); } }, OperationContext.Stage.RUNTIME);
@Override public void unregister(OperationContext context) throws OperationFailedException { Resource resource = context.readResource(PathAddress.EMPTY_ADDRESS); ManagementResourceRegistration registration = context.getResourceRegistrationForUpdate(); String protocolName = context.getCurrentAddressValue(); String moduleName = ProtocolResourceDefinition.Attribute.MODULE.resolveModelAttribute(context, resource.getModel()).asString(); Class<? extends Protocol> protocolClass = ChannelRuntimeResourceRegistration.findProtocolClass(context, protocolName, moduleName); for (String attribute : ProtocolMetricsHandler.findProtocolAttributes(protocolClass).keySet()) { registration.unregisterAttribute(attribute); } } }
WorkManagerStatisticsService wmStatsService = new WorkManagerStatisticsService(context.getResourceRegistrationForUpdate(), name, true); serviceTarget .addService(ConnectorServices.WORKMANAGER_STATS_SERVICE.append(name), wmStatsService)
@Override public void unregister(OperationContext context) { for (String name : context.readResource(PathAddress.EMPTY_ADDRESS).getChildrenNames(ProtocolResourceDefinition.WILDCARD_PATH.getKey())) { context.removeResource(PathAddress.pathAddress(ProtocolResourceDefinition.pathElement(name))); } context.getResourceRegistrationForUpdate().unregisterOverrideModel(context.getCurrentAddressValue()); }
.setInitialMode(ServiceController.Mode.ON_DEMAND) .install(); WorkManagerStatisticsService wmStatsService = new WorkManagerStatisticsService(context.getResourceRegistrationForUpdate(), name, true); serviceTarget .addService(ConnectorServices.WORKMANAGER_STATS_SERVICE.append(name), wmStatsService) .addDependency(ConnectorServices.WORKMANAGER_SERVICE.append(name), WorkManager.class, wmStatsService.getWorkManagerInjector()) .setInitialMode(ServiceController.Mode.PASSIVE).install(); DistributedWorkManagerStatisticsService dwmStatsService = new DistributedWorkManagerStatisticsService(context.getResourceRegistrationForUpdate(), name, true); serviceTarget .addService(ConnectorServices.DISTRIBUTED_WORKMANAGER_STATS_SERVICE.append(name), dwmStatsService)
AdminObjectStatisticsService adminObjectStatisticsService = new AdminObjectStatisticsService(context.getResourceRegistrationForUpdate(), poolName, statsEnabled);
final ManagementResourceRegistration registration = context.getResourceRegistrationForUpdate(); final ServiceName dataSourceServiceNameAlias = AbstractDataSourceService.getServiceName(bindInfo); final ServiceName dataSourceServiceName = context.getCapabilityServiceName(Capabilities.DATA_SOURCE_CAPABILITY_NAME, dsName, DataSource.class);
ManagementResourceRegistration registration = context.getResourceRegistrationForUpdate(); String protocolName = context.getCurrentAddressValue(); String moduleName = ProtocolResourceDefinition.Attribute.MODULE.resolveModelAttribute(context, resource.getModel()).asString();
ResourceAdapterStatisticsService raStatsService = new ResourceAdapterStatisticsService(context.getResourceRegistrationForUpdate(), name, statsEnabled);
ConnectionDefinitionStatisticsService connectionDefinitionStatisticsService = new ConnectionDefinitionStatisticsService(context.getResourceRegistrationForUpdate(), jndiName, poolName, statsEnabled);
ManagementResourceRegistration registration = context.getResourceRegistrationForUpdate().registerOverrideModel(context.getCurrentAddressValue(), provider);
@Override public ManagementResourceRegistration getResourceRegistrationForUpdate() { ManagementResourceRegistration parent = primaryContext.getResourceRegistrationForUpdate(); return parent.getSubModel(activeStep.address); }
@Override public void execute(OperationContext operationContext, ModelNode modelNode) throws OperationFailedException { secondRuntimeStep(context, operation, context.getResourceRegistrationForUpdate(), model, isXa()); } }, OperationContext.Stage.RUNTIME);
private void installStatistics(OperationContext context, String name) { ServiceName raActivatorsServiceName = PooledConnectionFactoryService.getResourceAdapterActivatorsServiceName(name); PooledConnectionFactoryStatisticsService statsService = new PooledConnectionFactoryStatisticsService(context.getResourceRegistrationForUpdate(), true); context.getServiceTarget().addService(raActivatorsServiceName.append("statistics"), statsService) .addDependency(raActivatorsServiceName, ResourceAdapterDeployment.class, statsService.getRADeploymentInjector()) .setInitialMode(ServiceController.Mode.PASSIVE) .install(); } /*
private void installStatistics(OperationContext context, String name) { ServiceName raActivatorsServiceName = PooledConnectionFactoryService.getResourceAdapterActivatorsServiceName(name); PooledConnectionFactoryStatisticsService statsService = new PooledConnectionFactoryStatisticsService(context.getResourceRegistrationForUpdate(), true); context.getServiceTarget().addService(raActivatorsServiceName.append("statistics"), statsService) .addDependency(raActivatorsServiceName, ResourceAdapterDeployment.class, statsService.getRADeploymentInjector()) .setInitialMode(ServiceController.Mode.PASSIVE) .install(); } }
@Override public void unregister(OperationContext context) throws OperationFailedException { Resource resource = context.readResource(PathAddress.EMPTY_ADDRESS); ManagementResourceRegistration registration = context.getResourceRegistrationForUpdate(); String protocolName = context.getCurrentAddressValue(); String moduleName = ProtocolResourceDefinition.Attribute.MODULE.resolveModelAttribute(context, resource.getModel()).asString(); Class<? extends Protocol> protocolClass = ChannelRuntimeResourceRegistration.findProtocolClass(context, protocolName, moduleName); for (String attribute : ProtocolMetricsHandler.findProtocolAttributes(protocolClass).keySet()) { registration.unregisterAttribute(attribute); } } }
WorkManagerStatisticsService wmStatsService = new WorkManagerStatisticsService(context.getResourceRegistrationForUpdate(), name, true); serviceTarget .addService(ConnectorServices.WORKMANAGER_STATS_SERVICE.append(name), wmStatsService)
@Override public void unregister(OperationContext context) { for (String name : context.readResource(PathAddress.EMPTY_ADDRESS).getChildrenNames(ProtocolResourceDefinition.WILDCARD_PATH.getKey())) { context.removeResource(PathAddress.pathAddress(ProtocolResourceDefinition.pathElement(name))); } context.getResourceRegistrationForUpdate().unregisterOverrideModel(context.getCurrentAddressValue()); }
@Override protected void performRemove(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { String name = context.getCurrentAddressValue(); if (this.allowRuntimeOnlyRegistration && (context.getRunningMode() == RunningMode.NORMAL)) { Resource resource = context.readResource(PathAddress.EMPTY_ADDRESS); for (ResourceEntry entry: resource.getChildren(ProtocolResourceDefinition.WILDCARD_PATH.getKey())) { context.removeResource(PathAddress.pathAddress(entry.getPathElement())); } context.getResourceRegistrationForUpdate().unregisterOverrideModel(name); } super.performRemove(context, operation, model); }
@Override protected void performRemove(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { String channelName = context.getCurrentAddressValue(); if (this.allowRuntimeOnlyRegistration && (context.getRunningMode() == RunningMode.NORMAL)) { Resource resource = context.readResource(PathAddress.EMPTY_ADDRESS); for (ResourceEntry entry: resource.getChildren(ProtocolResourceDefinition.WILDCARD_PATH.getKey())) { context.removeResource(PathAddress.pathAddress(entry.getPathElement())); } context.getResourceRegistrationForUpdate().unregisterOverrideModel(channelName); } super.performRemove(context, operation, model); }