Search in sources :

Example 1 with ExternalConnectionFactoryDefinition

use of org.wildfly.extension.messaging.activemq.jms.ExternalConnectionFactoryDefinition 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)

Aggregations

OperationContext (org.jboss.as.controller.OperationContext)1 SimpleResourceDefinition (org.jboss.as.controller.SimpleResourceDefinition)1 Parameters (org.jboss.as.controller.SimpleResourceDefinition.Parameters)1 SubsystemRegistration (org.jboss.as.controller.SubsystemRegistration)1 ManagementResourceRegistration (org.jboss.as.controller.registry.ManagementResourceRegistration)1 BroadcastCommandDispatcherFactoryInstaller (org.wildfly.extension.messaging.activemq.broadcast.BroadcastCommandDispatcherFactoryInstaller)1 ExternalConnectionFactoryDefinition (org.wildfly.extension.messaging.activemq.jms.ExternalConnectionFactoryDefinition)1 ExternalJMSQueueDefinition (org.wildfly.extension.messaging.activemq.jms.ExternalJMSQueueDefinition)1 ExternalJMSTopicDefinition (org.wildfly.extension.messaging.activemq.jms.ExternalJMSTopicDefinition)1 JMSQueueDefinition (org.wildfly.extension.messaging.activemq.jms.JMSQueueDefinition)1 JMSTopicDefinition (org.wildfly.extension.messaging.activemq.jms.JMSTopicDefinition)1