Search in sources :

Example 1 with MessagingDependencyProcessor

use of org.wildfly.extension.messaging.activemq.deployment.MessagingDependencyProcessor in project wildfly by wildfly.

the class MessagingSubsystemAdd method performBoottime.

@Override
protected void performBoottime(final OperationContext context, ModelNode operation, final ModelNode model) throws OperationFailedException {
    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());
            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());
            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());
    final int threadPoolMaxSizeValue;
    final int scheduledThreadPoolMaxSizeValue;
    // if Artemis System properties are defined, they have precedence over the default values of undefined
    // attributes from the management mode (for backwards compatibility).
    // if the attributes are defined, their value is used (and the system properties are ignored)
    Properties sysprops = System.getProperties();
    if (!threadPoolMaxSize.isDefined() && sysprops.containsKey(THREAD_POOL_MAX_SIZE_PROPERTY_KEY)) {
        threadPoolMaxSizeValue = Integer.parseInt(sysprops.getProperty(THREAD_POOL_MAX_SIZE_PROPERTY_KEY));
    } else {
        threadPoolMaxSizeValue = GLOBAL_CLIENT_THREAD_POOL_MAX_SIZE.resolveModelAttribute(context, operation).asInt();
    }
    if (!scheduledThreadPoolMaxSize.isDefined() && sysprops.containsKey(SCHEDULED_THREAD_POOL_SIZE_PROPERTY_KEY)) {
        scheduledThreadPoolMaxSizeValue = Integer.parseInt(sysprops.getProperty(SCHEDULED_THREAD_POOL_SIZE_PROPERTY_KEY));
    } else {
        scheduledThreadPoolMaxSizeValue = GLOBAL_CLIENT_SCHEDULED_THREAD_POOL_MAX_SIZE.resolveModelAttribute(context, operation).asInt();
    }
    MessagingLogger.ROOT_LOGGER.debugf("Setting global client thread pool size to: regular=%s, scheduled=%s", threadPoolMaxSizeValue, scheduledThreadPoolMaxSizeValue);
    ActiveMQClient.setGlobalThreadPoolProperties(threadPoolMaxSizeValue, scheduledThreadPoolMaxSizeValue);
}
Also used : 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) Properties(java.util.Properties) JMSConnectionFactoryDefinitionDescriptorProcessor(org.wildfly.extension.messaging.activemq.deployment.JMSConnectionFactoryDefinitionDescriptorProcessor) DefaultJMSConnectionFactoryResourceReferenceProcessor(org.wildfly.extension.messaging.activemq.deployment.DefaultJMSConnectionFactoryResourceReferenceProcessor) DeploymentProcessorTarget(org.jboss.as.server.DeploymentProcessorTarget) JMSDestinationDefinitionAnnotationProcessor(org.wildfly.extension.messaging.activemq.deployment.JMSDestinationDefinitionAnnotationProcessor) JMSConnectionFactoryDefinitionAnnotationProcessor(org.wildfly.extension.messaging.activemq.deployment.JMSConnectionFactoryDefinitionAnnotationProcessor) AbstractDeploymentChainStep(org.jboss.as.server.AbstractDeploymentChainStep) DefaultJMSConnectionFactoryBindingProcessor(org.wildfly.extension.messaging.activemq.deployment.DefaultJMSConnectionFactoryBindingProcessor) MessagingXmlParsingDeploymentUnitProcessor(org.wildfly.extension.messaging.activemq.deployment.MessagingXmlParsingDeploymentUnitProcessor) ModelNode(org.jboss.dmr.ModelNode)

Aggregations

Properties (java.util.Properties)1 AbstractDeploymentChainStep (org.jboss.as.server.AbstractDeploymentChainStep)1 DeploymentProcessorTarget (org.jboss.as.server.DeploymentProcessorTarget)1 ModelNode (org.jboss.dmr.ModelNode)1 DefaultJMSConnectionFactoryBindingProcessor (org.wildfly.extension.messaging.activemq.deployment.DefaultJMSConnectionFactoryBindingProcessor)1 DefaultJMSConnectionFactoryResourceReferenceProcessor (org.wildfly.extension.messaging.activemq.deployment.DefaultJMSConnectionFactoryResourceReferenceProcessor)1 JMSConnectionFactoryDefinitionAnnotationProcessor (org.wildfly.extension.messaging.activemq.deployment.JMSConnectionFactoryDefinitionAnnotationProcessor)1 JMSConnectionFactoryDefinitionDescriptorProcessor (org.wildfly.extension.messaging.activemq.deployment.JMSConnectionFactoryDefinitionDescriptorProcessor)1 JMSDestinationDefinitionAnnotationProcessor (org.wildfly.extension.messaging.activemq.deployment.JMSDestinationDefinitionAnnotationProcessor)1 JMSDestinationDefinitionDescriptorProcessor (org.wildfly.extension.messaging.activemq.deployment.JMSDestinationDefinitionDescriptorProcessor)1 MessagingDependencyProcessor (org.wildfly.extension.messaging.activemq.deployment.MessagingDependencyProcessor)1 MessagingXmlInstallDeploymentUnitProcessor (org.wildfly.extension.messaging.activemq.deployment.MessagingXmlInstallDeploymentUnitProcessor)1 MessagingXmlParsingDeploymentUnitProcessor (org.wildfly.extension.messaging.activemq.deployment.MessagingXmlParsingDeploymentUnitProcessor)1 CDIDeploymentProcessor (org.wildfly.extension.messaging.activemq.deployment.injection.CDIDeploymentProcessor)1