Search in sources :

Example 1 with DiscoveryJoiner

use of com.hazelcast.internal.cluster.impl.DiscoveryJoiner in project hazelcast by hazelcast.

the class Node method createJoiner.

Joiner createJoiner() {
    JoinConfig join = getActiveMemberNetworkConfig(config).getJoin();
    join.verify();
    if (shouldUseMulticastJoiner(join) && multicastService != null) {
        logger.info("Using Multicast discovery");
        return new MulticastJoiner(this);
    } else if (join.getTcpIpConfig().isEnabled()) {
        logger.info("Using TCP/IP discovery");
        return new TcpIpJoiner(this);
    } else if (properties.getBoolean(DISCOVERY_SPI_ENABLED) || isAnyAliasedConfigEnabled(join) || join.isAutoDetectionEnabled()) {
        logger.info("Using Discovery SPI");
        return new DiscoveryJoiner(this, discoveryService, usePublicAddress(join));
    }
    return null;
}
Also used : JoinConfig(com.hazelcast.config.JoinConfig) DiscoveryJoiner(com.hazelcast.internal.cluster.impl.DiscoveryJoiner) TcpIpJoiner(com.hazelcast.internal.cluster.impl.TcpIpJoiner) MulticastJoiner(com.hazelcast.internal.cluster.impl.MulticastJoiner)

Example 2 with DiscoveryJoiner

use of com.hazelcast.internal.cluster.impl.DiscoveryJoiner in project hazelcast by hazelcast.

the class Node method createJoiner.

Joiner createJoiner() {
    JoinConfig join = config.getNetworkConfig().getJoin();
    join.verify();
    if (properties.getBoolean(DISCOVERY_SPI_ENABLED)) {
        //TODO: Auto-Upgrade Multicast+AWS configuration!
        logger.info("Activating Discovery SPI Joiner");
        return new DiscoveryJoiner(this, discoveryService, properties.getBoolean(DISCOVERY_SPI_PUBLIC_IP_ENABLED));
    } else {
        if (join.getMulticastConfig().isEnabled() && multicastService != null) {
            logger.info("Creating MulticastJoiner");
            return new MulticastJoiner(this);
        } else if (join.getTcpIpConfig().isEnabled()) {
            logger.info("Creating TcpIpJoiner");
            return new TcpIpJoiner(this);
        } else if (join.getAwsConfig().isEnabled()) {
            Class clazz;
            try {
                logger.info("Creating AWSJoiner");
                clazz = Class.forName("com.hazelcast.cluster.impl.TcpIpJoinerOverAWS");
                Constructor constructor = clazz.getConstructor(Node.class);
                return (Joiner) constructor.newInstance(this);
            } catch (Exception e) {
                throw ExceptionUtil.rethrow(e);
            }
        }
    }
    return null;
}
Also used : MulticastJoiner(com.hazelcast.internal.cluster.impl.MulticastJoiner) DiscoveryJoiner(com.hazelcast.internal.cluster.impl.DiscoveryJoiner) Joiner(com.hazelcast.cluster.Joiner) TcpIpJoiner(com.hazelcast.cluster.impl.TcpIpJoiner) Constructor(java.lang.reflect.Constructor) JoinConfig(com.hazelcast.config.JoinConfig) DiscoveryJoiner(com.hazelcast.internal.cluster.impl.DiscoveryJoiner) TcpIpJoiner(com.hazelcast.cluster.impl.TcpIpJoiner) MulticastJoiner(com.hazelcast.internal.cluster.impl.MulticastJoiner)

Aggregations

JoinConfig (com.hazelcast.config.JoinConfig)2 DiscoveryJoiner (com.hazelcast.internal.cluster.impl.DiscoveryJoiner)2 MulticastJoiner (com.hazelcast.internal.cluster.impl.MulticastJoiner)2 Joiner (com.hazelcast.cluster.Joiner)1 TcpIpJoiner (com.hazelcast.cluster.impl.TcpIpJoiner)1 TcpIpJoiner (com.hazelcast.internal.cluster.impl.TcpIpJoiner)1 Constructor (java.lang.reflect.Constructor)1