Search in sources :

Example 1 with ExternalPooledConnectionFactoryService

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

the class ActiveMQResourceAdapter method createBroadcastEndpointFactory.

@Override
protected BroadcastEndpointFactory createBroadcastEndpointFactory(ConnectionFactoryProperties overrideProperties) {
    String clusterName = overrideProperties.getJgroupsChannelName() != null ? overrideProperties.getJgroupsChannelName() : getJgroupsChannelName();
    if (clusterName != null) {
        String channelRefName = this.getProperties().getJgroupsChannelRefName();
        String[] split = channelRefName.split("/");
        String serverName = split[0];
        String key = split[1];
        String pcf = null;
        if (key.indexOf(':') >= 0) {
            split = key.split(":");
            pcf = split[0];
            key = split[1];
        }
        if (serverName != null && !serverName.isEmpty()) {
            ActiveMQServerService service = (ActiveMQServerService) currentServiceContainer().getService(MessagingServices.getActiveMQServiceName(serverName)).getService();
            return new CommandDispatcherBroadcastEndpointFactory(service.getCommandDispatcherFactory(key), clusterName);
        }
        assert pcf != null;
        ExternalPooledConnectionFactoryService service = (ExternalPooledConnectionFactoryService) currentServiceContainer().getService(JMSServices.getPooledConnectionFactoryBaseServiceName(MessagingServices.getActiveMQServiceName()).append(pcf)).getService();
        return new CommandDispatcherBroadcastEndpointFactory(service.getCommandDispatcherFactory(key), clusterName);
    }
    return super.createBroadcastEndpointFactory(overrideProperties);
}
Also used : ExternalPooledConnectionFactoryService(org.wildfly.extension.messaging.activemq.jms.ExternalPooledConnectionFactoryService) CommandDispatcherBroadcastEndpointFactory(org.wildfly.extension.messaging.activemq.broadcast.CommandDispatcherBroadcastEndpointFactory)

Aggregations

CommandDispatcherBroadcastEndpointFactory (org.wildfly.extension.messaging.activemq.broadcast.CommandDispatcherBroadcastEndpointFactory)1 ExternalPooledConnectionFactoryService (org.wildfly.extension.messaging.activemq.jms.ExternalPooledConnectionFactoryService)1