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);
}
}
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;
}
Aggregations