Search in sources :

Example 16 with OperationContext

use of org.jboss.as.controller.OperationContext in project wildfly by wildfly.

the class RaActivate method execute.

public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
    final ModelNode address = operation.require(OP_ADDR);
    final String idName = PathAddress.pathAddress(address).getLastElement().getValue();
    ModelNode model = context.readResource(PathAddress.EMPTY_ADDRESS).getModel();
    final String archiveOrModuleName;
    if (!model.hasDefined(ARCHIVE.getName()) && !model.hasDefined(MODULE.getName())) {
        throw ConnectorLogger.ROOT_LOGGER.archiveOrModuleRequired();
    }
    if (model.get(ARCHIVE.getName()).isDefined()) {
        archiveOrModuleName = model.get(ARCHIVE.getName()).asString();
    } else {
        archiveOrModuleName = model.get(MODULE.getName()).asString();
    }
    if (context.isNormalServer()) {
        context.addStep(new OperationStepHandler() {

            public void execute(final OperationContext context, ModelNode operation) throws OperationFailedException {
                ServiceName restartedServiceName = RaOperationUtil.restartIfPresent(context, archiveOrModuleName, idName);
                if (restartedServiceName == null) {
                    RaOperationUtil.activate(context, idName, archiveOrModuleName);
                }
                context.completeStep(new OperationContext.RollbackHandler() {

                    @Override
                    public void handleRollback(OperationContext context, ModelNode operation) {
                        try {
                            RaOperationUtil.removeIfActive(context, archiveOrModuleName, idName);
                        } catch (OperationFailedException e) {
                        }
                    }
                });
            }
        }, OperationContext.Stage.RUNTIME);
    }
}
Also used : OperationContext(org.jboss.as.controller.OperationContext) ServiceName(org.jboss.msc.service.ServiceName) OperationStepHandler(org.jboss.as.controller.OperationStepHandler) OperationFailedException(org.jboss.as.controller.OperationFailedException) ModelNode(org.jboss.dmr.ModelNode)

Example 17 with OperationContext

use of org.jboss.as.controller.OperationContext in project wildfly by wildfly.

the class ManagementResourceDefinition method registerOperations.

@Override
public void registerOperations(ManagementResourceRegistration resourceRegistration) {
    super.registerOperations(resourceRegistration);
    for (final String statisticName : statistics.getNames()) {
        final ModelType modelType = getModelType(statistics.getType(statisticName));
        if (statistics.isOperation(statisticName)) {
            AttributeDefinition attributeDefinition = new SimpleAttributeDefinitionBuilder(statisticName, modelType, true).setXmlName(statisticName).setAllowExpression(true).setFlags(AttributeAccess.Flag.STORAGE_RUNTIME).build();
            OperationStepHandler operationHandler = new AbstractMetricsHandler() {

                @Override
                void handle(final ModelNode response, OperationContext context, final ModelNode operation) {
                    Object result = statistics.getValue(statisticName, entityManagerFactoryLookup, StatisticNameLookup.statisticNameLookup(statisticName), Path.path(PathAddress.pathAddress(operation.get(ADDRESS))));
                    if (result != null) {
                        setResponse(response, result, modelType);
                    }
                }
            };
            SimpleOperationDefinition definition = new SimpleOperationDefinition(statisticName, descriptionResolver, attributeDefinition);
            resourceRegistration.registerOperationHandler(definition, operationHandler);
        }
    }
}
Also used : OperationContext(org.jboss.as.controller.OperationContext) OperationStepHandler(org.jboss.as.controller.OperationStepHandler) ModelType(org.jboss.dmr.ModelType) AttributeDefinition(org.jboss.as.controller.AttributeDefinition) ModelNode(org.jboss.dmr.ModelNode) SimpleOperationDefinition(org.jboss.as.controller.SimpleOperationDefinition) SimpleAttributeDefinitionBuilder(org.jboss.as.controller.SimpleAttributeDefinitionBuilder)

Example 18 with OperationContext

use of org.jboss.as.controller.OperationContext in project wildfly by wildfly.

the class ManagementResourceDefinition method registerAttributes.

@Override
public void registerAttributes(ManagementResourceRegistration resourceRegistration) {
    super.registerAttributes(resourceRegistration);
    for (final String statisticName : statistics.getNames()) {
        final ModelType modelType = getModelType(statistics.getType(statisticName));
        final SimpleAttributeDefinitionBuilder simpleAttributeDefinitionBuilder = new SimpleAttributeDefinitionBuilder(statisticName, modelType, true).setXmlName(statisticName).setAllowExpression(true).setFlags(AttributeAccess.Flag.STORAGE_RUNTIME);
        if (statistics.isAttribute(statisticName)) {
            // WFLY-561 improves usability by using "statistics-enabled" instead of "enabled"
            if (ENABLED_ATTRIBUTE.equals(statisticName)) {
                simpleAttributeDefinitionBuilder.setDeprecated(ENABLED_ATTRIBUTE_DEPRECATED_MODEL_VERSION);
            }
            OperationStepHandler readHandler = new AbstractMetricsHandler() {

                @Override
                void handle(final ModelNode response, OperationContext context, final ModelNode operation) {
                    Object result = statistics.getValue(statisticName, entityManagerFactoryLookup, StatisticNameLookup.statisticNameLookup(statisticName), Path.path(PathAddress.pathAddress(operation.get(ADDRESS))));
                    if (result != null) {
                        setResponse(response, result, modelType);
                    }
                }
            };
            // handle writeable attributes
            if (statistics.isWriteable(statisticName)) {
                OperationStepHandler writeHandler = new AbstractMetricsHandler() {

                    @Override
                    void handle(final ModelNode response, OperationContext context, final ModelNode operation) {
                        Object oldSetting = statistics.getValue(statisticName, entityManagerFactoryLookup, StatisticNameLookup.statisticNameLookup(statisticName), Path.path(PathAddress.pathAddress(operation.get(ADDRESS))));
                        {
                            final ModelNode value = operation.get(ModelDescriptionConstants.VALUE).resolve();
                            if (Boolean.class.equals(statistics.getType(statisticName))) {
                                statistics.setValue(statisticName, value.asBoolean(), entityManagerFactoryLookup, StatisticNameLookup.statisticNameLookup(statisticName), Path.path(PathAddress.pathAddress(operation.get(ADDRESS))));
                            } else if (Integer.class.equals(statistics.getType(statisticName))) {
                                statistics.setValue(statisticName, value.asInt(), entityManagerFactoryLookup, StatisticNameLookup.statisticNameLookup(statisticName), Path.path(PathAddress.pathAddress(operation.get(ADDRESS))));
                            } else if (Long.class.equals(statistics.getType(statisticName))) {
                                statistics.setValue(statisticName, value.asLong(), entityManagerFactoryLookup, StatisticNameLookup.statisticNameLookup(statisticName), Path.path(PathAddress.pathAddress(operation.get(ADDRESS))));
                            } else {
                                statistics.setValue(statisticName, value.asString(), entityManagerFactoryLookup, StatisticNameLookup.statisticNameLookup(statisticName), Path.path(PathAddress.pathAddress(operation.get(ADDRESS))));
                            }
                        }
                        final Object rollBackValue = oldSetting;
                        context.completeStep(new OperationContext.RollbackHandler() {

                            @Override
                            public void handleRollback(OperationContext context, ModelNode operation) {
                                statistics.setValue(statisticName, rollBackValue, entityManagerFactoryLookup, StatisticNameLookup.statisticNameLookup(statisticName), Path.path(PathAddress.pathAddress(operation.get(ADDRESS))));
                            }
                        });
                    }
                };
                resourceRegistration.registerReadWriteAttribute(simpleAttributeDefinitionBuilder.build(), readHandler, writeHandler);
            } else {
                resourceRegistration.registerMetric(simpleAttributeDefinitionBuilder.build(), readHandler);
            }
        }
    }
}
Also used : OperationContext(org.jboss.as.controller.OperationContext) OperationStepHandler(org.jboss.as.controller.OperationStepHandler) ModelType(org.jboss.dmr.ModelType) ModelNode(org.jboss.dmr.ModelNode) SimpleAttributeDefinitionBuilder(org.jboss.as.controller.SimpleAttributeDefinitionBuilder)

Example 19 with OperationContext

use of org.jboss.as.controller.OperationContext in project wildfly by wildfly.

the class MessagingExtension method initialize.

@Override
public void initialize(ExtensionContext context) {
    // Initialize the Netty logger factory
    InternalLoggerFactory.setDefaultFactory(JdkLoggerFactory.INSTANCE);
    final SubsystemRegistration subsystemRegistration = context.registerSubsystem(SUBSYSTEM_NAME, CURRENT_MODEL_VERSION);
    subsystemRegistration.registerXMLElementWriter(CURRENT_PARSER);
    boolean registerRuntimeOnly = context.isRuntimeOnlyRegistrationValid();
    BiConsumer<OperationContext, String> broadcastCommandDispatcherFactoryInstaller = new BroadcastCommandDispatcherFactoryInstaller();
    // Root resource
    final ManagementResourceRegistration subsystem = subsystemRegistration.registerSubsystemModel(new MessagingSubsystemRootResourceDefinition(broadcastCommandDispatcherFactoryInstaller));
    subsystem.registerOperationHandler(GenericSubsystemDescribeHandler.DEFINITION, GenericSubsystemDescribeHandler.INSTANCE);
    // WFLY-10518 - register new client resources under subsystem
    subsystem.registerSubModel(new DiscoveryGroupDefinition(registerRuntimeOnly, true));
    subsystem.registerSubModel(new JGroupsDiscoveryGroupDefinition(registerRuntimeOnly, true));
    subsystem.registerSubModel(new SocketDiscoveryGroupDefinition(registerRuntimeOnly, true));
    subsystem.registerSubModel(GenericTransportDefinition.createConnectorDefinition(registerRuntimeOnly));
    subsystem.registerSubModel(InVMTransportDefinition.createConnectorDefinition(registerRuntimeOnly));
    subsystem.registerSubModel(RemoteTransportDefinition.createConnectorDefinition(registerRuntimeOnly));
    subsystem.registerSubModel(new HTTPConnectorDefinition(registerRuntimeOnly));
    subsystem.registerSubModel(new ExternalConnectionFactoryDefinition(registerRuntimeOnly));
    subsystem.registerSubModel(ExternalPooledConnectionFactoryDefinition.INSTANCE);
    subsystem.registerSubModel(new ExternalJMSQueueDefinition(registerRuntimeOnly));
    subsystem.registerSubModel(new ExternalJMSTopicDefinition(registerRuntimeOnly));
    // ActiveMQ Servers
    final ManagementResourceRegistration server = subsystem.registerSubModel(new ServerDefinition(broadcastCommandDispatcherFactoryInstaller, registerRuntimeOnly));
    for (PathDefinition path : new PathDefinition[] { PathDefinition.JOURNAL_INSTANCE, PathDefinition.BINDINGS_INSTANCE, PathDefinition.LARGE_MESSAGES_INSTANCE, PathDefinition.PAGING_INSTANCE }) {
        ManagementResourceRegistration pathRegistry = server.registerSubModel(path);
        PathDefinition.registerResolveOperationHandler(context, pathRegistry);
    }
    subsystem.registerSubModel(JMSBridgeDefinition.INSTANCE);
    if (registerRuntimeOnly) {
        final ManagementResourceRegistration deployment = subsystemRegistration.registerDeploymentModel(new SimpleResourceDefinition(new Parameters(SUBSYSTEM_PATH, getResourceDescriptionResolver("deployed")).setFeature(false)));
        deployment.registerSubModel(new ExternalConnectionFactoryDefinition(registerRuntimeOnly));
        deployment.registerSubModel(ExternalPooledConnectionFactoryDefinition.DEPLOYMENT_INSTANCE);
        deployment.registerSubModel(new ExternalJMSQueueDefinition(registerRuntimeOnly));
        deployment.registerSubModel(new ExternalJMSTopicDefinition(registerRuntimeOnly));
        final ManagementResourceRegistration deployedServer = deployment.registerSubModel(new SimpleResourceDefinition(new Parameters(SERVER_PATH, getResourceDescriptionResolver(SERVER)).setFeature(false)));
        deployedServer.registerSubModel(new JMSQueueDefinition(true, registerRuntimeOnly));
        deployedServer.registerSubModel(new JMSTopicDefinition(true, registerRuntimeOnly));
        deployedServer.registerSubModel(PooledConnectionFactoryDefinition.DEPLOYMENT_INSTANCE);
    }
}
Also used : OperationContext(org.jboss.as.controller.OperationContext) JMSTopicDefinition(org.wildfly.extension.messaging.activemq.jms.JMSTopicDefinition) ExternalJMSTopicDefinition(org.wildfly.extension.messaging.activemq.jms.ExternalJMSTopicDefinition) Parameters(org.jboss.as.controller.SimpleResourceDefinition.Parameters) SimpleResourceDefinition(org.jboss.as.controller.SimpleResourceDefinition) BroadcastCommandDispatcherFactoryInstaller(org.wildfly.extension.messaging.activemq.broadcast.BroadcastCommandDispatcherFactoryInstaller) ManagementResourceRegistration(org.jboss.as.controller.registry.ManagementResourceRegistration) SubsystemRegistration(org.jboss.as.controller.SubsystemRegistration) ExternalConnectionFactoryDefinition(org.wildfly.extension.messaging.activemq.jms.ExternalConnectionFactoryDefinition) ExternalJMSTopicDefinition(org.wildfly.extension.messaging.activemq.jms.ExternalJMSTopicDefinition) ExternalJMSQueueDefinition(org.wildfly.extension.messaging.activemq.jms.ExternalJMSQueueDefinition) ExternalJMSQueueDefinition(org.wildfly.extension.messaging.activemq.jms.ExternalJMSQueueDefinition) JMSQueueDefinition(org.wildfly.extension.messaging.activemq.jms.JMSQueueDefinition)

Example 20 with OperationContext

use of org.jboss.as.controller.OperationContext in project wildfly by wildfly.

the class MessagingSubsystemAdd method performBoottime.

@Override
protected void performBoottime(final OperationContext context, ModelNode operation, final ModelNode model) throws OperationFailedException {
    // Cache support for capability service name lookups by our services
    MessagingServices.capabilityServiceSupport = context.getCapabilityServiceSupport();
    context.addStep(new AbstractDeploymentChainStep() {

        @Override
        protected void execute(DeploymentProcessorTarget processorTarget) {
            // keep the statements ordered by phase + priority
            processorTarget.addDeploymentProcessor(MessagingExtension.SUBSYSTEM_NAME, Phase.STRUCTURE, Phase.STRUCTURE_JMS_CONNECTION_FACTORY_RESOURCE_INJECTION, new DefaultJMSConnectionFactoryResourceReferenceProcessor());
            processorTarget.addDeploymentProcessor(MessagingExtension.SUBSYSTEM_NAME, Phase.PARSE, Phase.PARSE_RESOURCE_DEF_ANNOTATION_JMS_DESTINATION, new JMSDestinationDefinitionAnnotationProcessor());
            processorTarget.addDeploymentProcessor(MessagingExtension.SUBSYSTEM_NAME, Phase.PARSE, Phase.PARSE_RESOURCE_DEF_ANNOTATION_JMS_CONNECTION_FACTORY, new JMSConnectionFactoryDefinitionAnnotationProcessor(MessagingServices.capabilityServiceSupport.hasCapability("org.wildfly.legacy-security")));
            processorTarget.addDeploymentProcessor(MessagingExtension.SUBSYSTEM_NAME, Phase.PARSE, Phase.PARSE_MESSAGING_XML_RESOURCES, new MessagingXmlParsingDeploymentUnitProcessor());
            processorTarget.addDeploymentProcessor(MessagingExtension.SUBSYSTEM_NAME, Phase.DEPENDENCIES, Phase.DEPENDENCIES_JMS, new MessagingDependencyProcessor());
            if (MessagingServices.capabilityServiceSupport.hasCapability(WELD_CAPABILITY_NAME)) {
                processorTarget.addDeploymentProcessor(MessagingExtension.SUBSYSTEM_NAME, Phase.POST_MODULE, Phase.POST_MODULE_JMS_CDI_EXTENSIONS, new CDIDeploymentProcessor());
            }
            processorTarget.addDeploymentProcessor(MessagingExtension.SUBSYSTEM_NAME, Phase.POST_MODULE, Phase.POST_MODULE_RESOURCE_DEF_XML_JMS_CONNECTION_FACTORY, new JMSConnectionFactoryDefinitionDescriptorProcessor());
            processorTarget.addDeploymentProcessor(MessagingExtension.SUBSYSTEM_NAME, Phase.POST_MODULE, Phase.POST_MODULE_RESOURCE_DEF_XML_JMS_DESTINATION, new JMSDestinationDefinitionDescriptorProcessor());
            processorTarget.addDeploymentProcessor(MessagingExtension.SUBSYSTEM_NAME, Phase.INSTALL, Phase.INSTALL_DEFAULT_BINDINGS_JMS_CONNECTION_FACTORY, new DefaultJMSConnectionFactoryBindingProcessor());
            processorTarget.addDeploymentProcessor(MessagingExtension.SUBSYSTEM_NAME, Phase.INSTALL, Phase.INSTALL_MESSAGING_XML_RESOURCES, new MessagingXmlInstallDeploymentUnitProcessor());
        }
    }, OperationContext.Stage.RUNTIME);
    ModelNode threadPoolMaxSize = operation.get(GLOBAL_CLIENT_THREAD_POOL_MAX_SIZE.getName());
    ModelNode scheduledThreadPoolMaxSize = operation.get(GLOBAL_CLIENT_SCHEDULED_THREAD_POOL_MAX_SIZE.getName());
    Integer threadPoolMaxSizeValue;
    Integer scheduledThreadPoolMaxSizeValue;
    // if the attributes are defined, their value is used (and the system properties are ignored)
    Properties sysprops = System.getProperties();
    if (threadPoolMaxSize.isDefined()) {
        threadPoolMaxSizeValue = GLOBAL_CLIENT_THREAD_POOL_MAX_SIZE.resolveModelAttribute(context, operation).asInt();
    } else if (sysprops.containsKey(THREAD_POOL_MAX_SIZE_PROPERTY_KEY)) {
        threadPoolMaxSizeValue = Integer.parseInt(sysprops.getProperty(THREAD_POOL_MAX_SIZE_PROPERTY_KEY));
    } else {
        // property is not configured using sysprop or explicit attribute
        threadPoolMaxSizeValue = null;
    }
    if (scheduledThreadPoolMaxSize.isDefined()) {
        scheduledThreadPoolMaxSizeValue = GLOBAL_CLIENT_SCHEDULED_THREAD_POOL_MAX_SIZE.resolveModelAttribute(context, operation).asInt();
    } else if (sysprops.containsKey(SCHEDULED_THREAD_POOL_SIZE_PROPERTY_KEY)) {
        scheduledThreadPoolMaxSizeValue = Integer.parseInt(sysprops.getProperty(SCHEDULED_THREAD_POOL_SIZE_PROPERTY_KEY));
    } else {
        // property is not configured using sysprop or explicit attribute
        scheduledThreadPoolMaxSizeValue = null;
    }
    if (threadPoolMaxSizeValue != null || scheduledThreadPoolMaxSizeValue != null) {
        ActiveMQClient.initializeGlobalThreadPoolProperties();
        if (threadPoolMaxSizeValue == null) {
            threadPoolMaxSizeValue = ActiveMQClient.getGlobalThreadPoolSize();
        }
        if (scheduledThreadPoolMaxSizeValue == null) {
            scheduledThreadPoolMaxSizeValue = ActiveMQClient.getGlobalScheduledThreadPoolSize();
        }
        MessagingLogger.ROOT_LOGGER.debugf("Setting global client thread pool size to: regular=%s, scheduled=%s", threadPoolMaxSizeValue, scheduledThreadPoolMaxSizeValue);
        ActiveMQClient.setGlobalThreadPoolProperties(threadPoolMaxSizeValue, scheduledThreadPoolMaxSizeValue);
    }
    context.getServiceTarget().addService(MessagingServices.ACTIVEMQ_CLIENT_THREAD_POOL).setInstance(new ThreadPoolService()).install();
    context.addStep(new OperationStepHandler() {

        @Override
        public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
            final ServiceTarget serviceTarget = context.getServiceTarget();
            final ServiceBuilder serviceBuilder = serviceTarget.addService(CONFIGURATION_CAPABILITY.getCapabilityServiceName());
            // Transform the configuration based on the recursive model
            final ModelNode model = Resource.Tools.readModel(context.readResource(PathAddress.EMPTY_ADDRESS));
            // Process connectors
            final Set<String> connectorsSocketBindings = new HashSet<String>();
            final Map<String, TransportConfiguration> connectors = TransportConfigOperationHandlers.processConnectors(context, "localhost", model, connectorsSocketBindings);
            Map<String, ServiceName> outboundSocketBindings = new HashMap<>();
            Map<String, Boolean> outbounds = TransportConfigOperationHandlers.listOutBoundSocketBinding(context, connectorsSocketBindings);
            Map<String, ServiceName> socketBindings = new HashMap<>();
            for (final String connectorSocketBinding : connectorsSocketBindings) {
                // find whether the connectorSocketBinding references a SocketBinding or an OutboundSocketBinding
                if (outbounds.get(connectorSocketBinding)) {
                    final ServiceName outboundSocketName = OUTBOUND_SOCKET_BINDING_CAPABILITY.getCapabilityServiceName(connectorSocketBinding);
                    outboundSocketBindings.put(connectorSocketBinding, outboundSocketName);
                } else {
                    // check if the socket binding has not already been added by the acceptors
                    if (!socketBindings.containsKey(connectorSocketBinding)) {
                        socketBindings.put(connectorSocketBinding, SOCKET_BINDING_CAPABILITY.getCapabilityServiceName(connectorSocketBinding));
                    }
                }
            }
            final List<BroadcastGroupConfiguration> broadcastGroupConfigurations = new ArrayList<>();
            // this requires connectors
            BroadcastGroupAdd.addBroadcastGroupConfigs(context, broadcastGroupConfigurations, connectors.keySet(), model);
            final Map<String, DiscoveryGroupConfiguration> discoveryGroupConfigurations = ConfigurationHelper.addDiscoveryGroupConfigurations(context, model);
            final Map<String, String> clusterNames = new HashMap<>();
            final Map<String, ServiceName> commandDispatcherFactories = new HashMap<>();
            final Map<String, ServiceName> groupBindings = new HashMap<>();
            final Set<ServiceName> groupBindingServices = new HashSet<>();
            for (final BroadcastGroupConfiguration config : broadcastGroupConfigurations) {
                final String name = config.getName();
                final String key = "broadcast" + name;
                if (model.hasDefined(JGROUPS_BROADCAST_GROUP, name)) {
                    ModelNode broadcastGroupModel = model.get(JGROUPS_BROADCAST_GROUP, name);
                    String channelName = JGroupsBroadcastGroupDefinition.JGROUPS_CHANNEL.resolveModelAttribute(context, broadcastGroupModel).asStringOrNull();
                    MessagingSubsystemAdd.this.broadcastCommandDispatcherFactoryInstaller.accept(context, channelName);
                    commandDispatcherFactories.put(key, MessagingServices.getBroadcastCommandDispatcherFactoryServiceName(channelName));
                    String clusterName = JGROUPS_CLUSTER.resolveModelAttribute(context, broadcastGroupModel).asString();
                    clusterNames.put(key, clusterName);
                } else {
                    final ServiceName groupBindingServiceName = GroupBindingService.getBroadcastBaseServiceName(JBOSS_MESSAGING_ACTIVEMQ).append(name);
                    if (!groupBindingServices.contains(groupBindingServiceName)) {
                        groupBindingServices.add(groupBindingServiceName);
                    }
                    groupBindings.put(key, groupBindingServiceName);
                }
            }
            for (final DiscoveryGroupConfiguration config : discoveryGroupConfigurations.values()) {
                final String name = config.getName();
                final String key = "discovery" + name;
                if (model.hasDefined(JGROUPS_DISCOVERY_GROUP, name)) {
                    ModelNode discoveryGroupModel = model.get(JGROUPS_DISCOVERY_GROUP, name);
                    String channelName = JGroupsDiscoveryGroupDefinition.JGROUPS_CHANNEL.resolveModelAttribute(context, discoveryGroupModel).asStringOrNull();
                    MessagingSubsystemAdd.this.broadcastCommandDispatcherFactoryInstaller.accept(context, channelName);
                    commandDispatcherFactories.put(key, MessagingServices.getBroadcastCommandDispatcherFactoryServiceName(channelName));
                    String clusterName = JGROUPS_CLUSTER.resolveModelAttribute(context, discoveryGroupModel).asString();
                    clusterNames.put(key, clusterName);
                } else {
                    final ServiceName groupBindingServiceName = GroupBindingService.getDiscoveryBaseServiceName(JBOSS_MESSAGING_ACTIVEMQ).append(name);
                    if (!groupBindingServices.contains(groupBindingServiceName)) {
                        groupBindingServices.add(groupBindingServiceName);
                    }
                    groupBindings.put(key, groupBindingServiceName);
                }
            }
            serviceBuilder.setInstance(new ExternalBrokerConfigurationService(connectors, discoveryGroupConfigurations, socketBindings, outboundSocketBindings, groupBindings, commandDispatcherFactories, clusterNames)).install();
        }
    }, OperationContext.Stage.RUNTIME);
}
Also used : Set(java.util.Set) HashSet(java.util.HashSet) Properties(java.util.Properties) JMSConnectionFactoryDefinitionDescriptorProcessor(org.wildfly.extension.messaging.activemq.deployment.JMSConnectionFactoryDefinitionDescriptorProcessor) DefaultJMSConnectionFactoryResourceReferenceProcessor(org.wildfly.extension.messaging.activemq.deployment.DefaultJMSConnectionFactoryResourceReferenceProcessor) ServiceBuilder(org.jboss.msc.service.ServiceBuilder) JMSConnectionFactoryDefinitionAnnotationProcessor(org.wildfly.extension.messaging.activemq.deployment.JMSConnectionFactoryDefinitionAnnotationProcessor) List(java.util.List) ArrayList(java.util.ArrayList) DefaultJMSConnectionFactoryBindingProcessor(org.wildfly.extension.messaging.activemq.deployment.DefaultJMSConnectionFactoryBindingProcessor) MessagingXmlParsingDeploymentUnitProcessor(org.wildfly.extension.messaging.activemq.deployment.MessagingXmlParsingDeploymentUnitProcessor) BroadcastGroupConfiguration(org.apache.activemq.artemis.api.core.BroadcastGroupConfiguration) OperationContext(org.jboss.as.controller.OperationContext) MessagingDependencyProcessor(org.wildfly.extension.messaging.activemq.deployment.MessagingDependencyProcessor) CDIDeploymentProcessor(org.wildfly.extension.messaging.activemq.deployment.injection.CDIDeploymentProcessor) JMSDestinationDefinitionDescriptorProcessor(org.wildfly.extension.messaging.activemq.deployment.JMSDestinationDefinitionDescriptorProcessor) MessagingXmlInstallDeploymentUnitProcessor(org.wildfly.extension.messaging.activemq.deployment.MessagingXmlInstallDeploymentUnitProcessor) OperationStepHandler(org.jboss.as.controller.OperationStepHandler) ServiceTarget(org.jboss.msc.service.ServiceTarget) OperationFailedException(org.jboss.as.controller.OperationFailedException) DiscoveryGroupConfiguration(org.apache.activemq.artemis.api.core.DiscoveryGroupConfiguration) DeploymentProcessorTarget(org.jboss.as.server.DeploymentProcessorTarget) ServiceName(org.jboss.msc.service.ServiceName) JMSDestinationDefinitionAnnotationProcessor(org.wildfly.extension.messaging.activemq.deployment.JMSDestinationDefinitionAnnotationProcessor) AbstractDeploymentChainStep(org.jboss.as.server.AbstractDeploymentChainStep) ModelNode(org.jboss.dmr.ModelNode) Map(java.util.Map) HashMap(java.util.HashMap)

Aggregations

OperationContext (org.jboss.as.controller.OperationContext)67 ModelNode (org.jboss.dmr.ModelNode)66 OperationFailedException (org.jboss.as.controller.OperationFailedException)51 OperationStepHandler (org.jboss.as.controller.OperationStepHandler)45 PathAddress (org.jboss.as.controller.PathAddress)25 Resource (org.jboss.as.controller.registry.Resource)18 AttributeDefinition (org.jboss.as.controller.AttributeDefinition)15 ServiceController (org.jboss.msc.service.ServiceController)13 ServiceName (org.jboss.msc.service.ServiceName)12 ArrayList (java.util.ArrayList)8 ReloadRequiredWriteAttributeHandler (org.jboss.as.controller.ReloadRequiredWriteAttributeHandler)8 List (java.util.List)7 SimpleAttributeDefinition (org.jboss.as.controller.SimpleAttributeDefinition)7 Map (java.util.Map)6 Collection (java.util.Collection)5 SimpleOperationDefinitionBuilder (org.jboss.as.controller.SimpleOperationDefinitionBuilder)5 AbstractDeploymentChainStep (org.jboss.as.server.AbstractDeploymentChainStep)5 DeploymentProcessorTarget (org.jboss.as.server.DeploymentProcessorTarget)5 ServiceBuilder (org.jboss.msc.service.ServiceBuilder)5 ServiceRegistry (org.jboss.msc.service.ServiceRegistry)5