Search in sources :

Example 1 with JMSTopicDefinition

use of org.wildfly.extension.messaging.activemq.jms.JMSTopicDefinition 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 2 with JMSTopicDefinition

use of org.wildfly.extension.messaging.activemq.jms.JMSTopicDefinition in project wildfly by wildfly.

the class ServerDefinition method getChildren.

@Override
protected List<? extends PersistentResourceDefinition> getChildren() {
    List<PersistentResourceDefinition> children = new ArrayList<>();
    // Static resources
    children.addAll(Arrays.asList(// HA policy
    LiveOnlyDefinition.INSTANCE, registerRuntimeOnly ? ReplicationMasterDefinition.INSTANCE : ReplicationMasterDefinition.HC_INSTANCE, registerRuntimeOnly ? ReplicationSlaveDefinition.INSTANCE : ReplicationSlaveDefinition.HC_INSTANCE, ReplicationColocatedDefinition.INSTANCE, SharedStoreMasterDefinition.INSTANCE, SharedStoreSlaveDefinition.INSTANCE, SharedStoreColocatedDefinition.INSTANCE, AddressSettingDefinition.INSTANCE, SecuritySettingDefinition.INSTANCE, // Acceptors
    HTTPAcceptorDefinition.INSTANCE, DivertDefinition.INSTANCE, ConnectorServiceDefinition.INSTANCE, GroupingHandlerDefinition.INSTANCE, // Jakarta Messaging resources
    LegacyConnectionFactoryDefinition.INSTANCE, PooledConnectionFactoryDefinition.INSTANCE));
    // Dynamic resources (depending on registerRuntimeOnly)
    // acceptors
    children.add(GenericTransportDefinition.createAcceptorDefinition(registerRuntimeOnly));
    children.add(InVMTransportDefinition.createAcceptorDefinition(registerRuntimeOnly));
    children.add(RemoteTransportDefinition.createAcceptorDefinition(registerRuntimeOnly));
    // connectors
    children.add(GenericTransportDefinition.createConnectorDefinition(registerRuntimeOnly));
    children.add(InVMTransportDefinition.createConnectorDefinition(registerRuntimeOnly));
    children.add(RemoteTransportDefinition.createConnectorDefinition(registerRuntimeOnly));
    children.add(new HTTPConnectorDefinition(registerRuntimeOnly));
    children.add(new BridgeDefinition(registerRuntimeOnly));
    children.add(new BroadcastGroupDefinition(registerRuntimeOnly));
    children.add(new SocketBroadcastGroupDefinition(registerRuntimeOnly));
    children.add(new JGroupsBroadcastGroupDefinition(registerRuntimeOnly));
    // WFLY-10518 - keep discovery-group resource under server
    children.add(new DiscoveryGroupDefinition(registerRuntimeOnly, false));
    children.add(new JGroupsDiscoveryGroupDefinition(registerRuntimeOnly, false));
    children.add(new SocketDiscoveryGroupDefinition(registerRuntimeOnly, false));
    children.add(new ClusterConnectionDefinition(registerRuntimeOnly));
    children.add(new QueueDefinition(registerRuntimeOnly, MessagingExtension.QUEUE_PATH));
    children.add(new JMSQueueDefinition(false, registerRuntimeOnly));
    children.add(new JMSTopicDefinition(false, registerRuntimeOnly));
    children.add(new ConnectionFactoryDefinition(registerRuntimeOnly));
    return children;
}
Also used : JMSTopicDefinition(org.wildfly.extension.messaging.activemq.jms.JMSTopicDefinition) JMSQueueDefinition(org.wildfly.extension.messaging.activemq.jms.JMSQueueDefinition) ArrayList(java.util.ArrayList) ConnectionFactoryDefinition(org.wildfly.extension.messaging.activemq.jms.ConnectionFactoryDefinition) PooledConnectionFactoryDefinition(org.wildfly.extension.messaging.activemq.jms.PooledConnectionFactoryDefinition) LegacyConnectionFactoryDefinition(org.wildfly.extension.messaging.activemq.jms.legacy.LegacyConnectionFactoryDefinition) PersistentResourceDefinition(org.jboss.as.controller.PersistentResourceDefinition) JMSQueueDefinition(org.wildfly.extension.messaging.activemq.jms.JMSQueueDefinition)

Aggregations

JMSQueueDefinition (org.wildfly.extension.messaging.activemq.jms.JMSQueueDefinition)2 JMSTopicDefinition (org.wildfly.extension.messaging.activemq.jms.JMSTopicDefinition)2 ArrayList (java.util.ArrayList)1 OperationContext (org.jboss.as.controller.OperationContext)1 PersistentResourceDefinition (org.jboss.as.controller.PersistentResourceDefinition)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 ConnectionFactoryDefinition (org.wildfly.extension.messaging.activemq.jms.ConnectionFactoryDefinition)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 PooledConnectionFactoryDefinition (org.wildfly.extension.messaging.activemq.jms.PooledConnectionFactoryDefinition)1 LegacyConnectionFactoryDefinition (org.wildfly.extension.messaging.activemq.jms.legacy.LegacyConnectionFactoryDefinition)1