Search in sources :

Example 1 with UDPBroadcastGroupConfiguration

use of org.hornetq.api.core.UDPBroadcastGroupConfiguration in project wildfly by wildfly.

the class LegacyConnectionFactoryService method translateDiscoveryGroupConfiguration.

private DiscoveryGroupConfiguration translateDiscoveryGroupConfiguration(org.apache.activemq.artemis.api.core.DiscoveryGroupConfiguration newDiscoveryGroupConfiguration) throws StartException {
    org.apache.activemq.artemis.api.core.BroadcastEndpointFactory newBroadcastEndpointFactory = newDiscoveryGroupConfiguration.getBroadcastEndpointFactory();
    BroadcastEndpointFactoryConfiguration legacyBroadcastEndpointFactory;
    if (newBroadcastEndpointFactory instanceof org.apache.activemq.artemis.api.core.UDPBroadcastEndpointFactory) {
        org.apache.activemq.artemis.api.core.UDPBroadcastEndpointFactory factory = (org.apache.activemq.artemis.api.core.UDPBroadcastEndpointFactory) newBroadcastEndpointFactory;
        legacyBroadcastEndpointFactory = new UDPBroadcastGroupConfiguration(factory.getGroupAddress(), factory.getGroupPort(), factory.getLocalBindAddress(), factory.getLocalBindPort());
    } else if (newBroadcastEndpointFactory instanceof org.apache.activemq.artemis.api.core.ChannelBroadcastEndpointFactory) {
        org.apache.activemq.artemis.api.core.ChannelBroadcastEndpointFactory factory = (org.apache.activemq.artemis.api.core.ChannelBroadcastEndpointFactory) newBroadcastEndpointFactory;
        legacyBroadcastEndpointFactory = new org.hornetq.api.core.JGroupsBroadcastGroupConfiguration(factory.getChannel(), factory.getChannelName());
    } else {
        throw MessagingLogger.ROOT_LOGGER.unsupportedBroadcastGroupConfigurationForLegacy(newBroadcastEndpointFactory.getClass().getName());
    }
    return new DiscoveryGroupConfiguration(newDiscoveryGroupConfiguration.getName(), newDiscoveryGroupConfiguration.getRefreshTimeout(), newDiscoveryGroupConfiguration.getDiscoveryInitialWaitTimeout(), legacyBroadcastEndpointFactory);
}
Also used : BroadcastEndpointFactoryConfiguration(org.hornetq.api.core.BroadcastEndpointFactoryConfiguration) DiscoveryGroupConfiguration(org.hornetq.api.core.DiscoveryGroupConfiguration) UDPBroadcastGroupConfiguration(org.hornetq.api.core.UDPBroadcastGroupConfiguration)

Aggregations

BroadcastEndpointFactoryConfiguration (org.hornetq.api.core.BroadcastEndpointFactoryConfiguration)1 DiscoveryGroupConfiguration (org.hornetq.api.core.DiscoveryGroupConfiguration)1 UDPBroadcastGroupConfiguration (org.hornetq.api.core.UDPBroadcastGroupConfiguration)1