Search in sources :

Example 61 with JoinConfig

use of com.hazelcast.config.JoinConfig in project hazelcast by hazelcast.

the class MemberDomConfigProcessor method handleMemberList.

protected void handleMemberList(Node node, boolean advancedNetworkConfig) {
    JoinConfig join = joinConfig(advancedNetworkConfig);
    TcpIpConfig tcpIpConfig = join.getTcpIpConfig();
    for (Node n : childElements(node)) {
        String nodeName = cleanNodeName(n);
        if (matches("member", nodeName)) {
            tcpIpConfig.addMember(getTextContent(n));
        }
    }
}
Also used : Node(org.w3c.dom.Node) JoinConfig(com.hazelcast.config.JoinConfig) TcpIpConfig(com.hazelcast.config.TcpIpConfig)

Example 62 with JoinConfig

use of com.hazelcast.config.JoinConfig in project hazelcast by hazelcast.

the class MemberDomConfigProcessor method handleJoin.

private void handleJoin(Node node, boolean advancedNetworkConfig) {
    JoinConfig joinConfig = joinConfig(advancedNetworkConfig);
    for (Node child : childElements(node)) {
        String name = cleanNodeName(child);
        if (matches("multicast", name)) {
            handleMulticast(child, advancedNetworkConfig);
        } else if (matches("tcp-ip", name)) {
            handleTcpIp(child, advancedNetworkConfig);
        } else if (AliasedDiscoveryConfigUtils.supports(name)) {
            handleAliasedDiscoveryStrategy(joinConfig, child, name);
        } else if (matches("discovery-strategies", name)) {
            handleDiscoveryStrategies(joinConfig.getDiscoveryConfig(), child);
        } else if (matches("auto-detection", name)) {
            handleAutoDetection(child, advancedNetworkConfig);
        }
    }
    joinConfig.verify();
}
Also used : Node(org.w3c.dom.Node) JoinConfig(com.hazelcast.config.JoinConfig)

Example 63 with JoinConfig

use of com.hazelcast.config.JoinConfig in project hazelcast by hazelcast.

the class MemberDomConfigProcessor method handleAutoDetection.

private void handleAutoDetection(Node node, boolean advancedNetworkConfig) {
    JoinConfig join = joinConfig(advancedNetworkConfig);
    AutoDetectionConfig autoDetectionConfig = join.getAutoDetectionConfig();
    NamedNodeMap attributes = node.getAttributes();
    for (int a = 0; a < attributes.getLength(); a++) {
        Node att = attributes.item(a);
        if (matches("enabled", lowerCaseInternal(att.getNodeName()))) {
            autoDetectionConfig.setEnabled(getBooleanValue(getTextContent(att)));
        }
    }
}
Also used : NamedNodeMap(org.w3c.dom.NamedNodeMap) Node(org.w3c.dom.Node) JoinConfig(com.hazelcast.config.JoinConfig) AutoDetectionConfig(com.hazelcast.config.AutoDetectionConfig)

Example 64 with JoinConfig

use of com.hazelcast.config.JoinConfig in project hazelcast by hazelcast.

the class MulticastDeserializationTest method createConfig.

private Config createConfig(boolean withFilter) {
    Config config = smallInstanceConfig();
    if (withFilter) {
        JavaSerializationFilterConfig javaSerializationFilterConfig = new JavaSerializationFilterConfig().setDefaultsDisabled(true);
        javaSerializationFilterConfig.getBlacklist().addClasses(TestDeserialized.class.getName());
        config.getSerializationConfig().setJavaSerializationFilterConfig(javaSerializationFilterConfig);
    }
    JoinConfig join = config.getNetworkConfig().getJoin();
    join.getTcpIpConfig().setEnabled(false);
    join.getMulticastConfig().setEnabled(true).setMulticastPort(MULTICAST_PORT).setMulticastGroup(MULTICAST_GROUP).setMulticastTimeToLive(MULTICAST_TTL);
    return config;
}
Also used : TestDeserialized(example.serialization.TestDeserialized) JavaSerializationFilterConfig(com.hazelcast.config.JavaSerializationFilterConfig) HazelcastTestSupport.smallInstanceConfig(com.hazelcast.test.HazelcastTestSupport.smallInstanceConfig) JoinConfig(com.hazelcast.config.JoinConfig) Config(com.hazelcast.config.Config) JoinConfig(com.hazelcast.config.JoinConfig) JavaSerializationFilterConfig(com.hazelcast.config.JavaSerializationFilterConfig)

Example 65 with JoinConfig

use of com.hazelcast.config.JoinConfig in project hazelcast by hazelcast.

the class SplitBrainHandlerTest method buildConfig.

private Config buildConfig(final String clusterName, final boolean liteMember) {
    Config config = new Config();
    config.setProperty(ClusterProperty.MERGE_FIRST_RUN_DELAY_SECONDS.getName(), "5");
    config.setProperty(ClusterProperty.MERGE_NEXT_RUN_DELAY_SECONDS.getName(), "3");
    config.setClusterName(clusterName);
    config.setLiteMember(liteMember);
    NetworkConfig networkConfig = config.getNetworkConfig();
    JoinConfig join = networkConfig.getJoin();
    join.getMulticastConfig().setEnabled(true);
    config.getMapConfig("default").getMergePolicyConfig().setPolicy(PassThroughMergePolicy.class.getName());
    return config;
}
Also used : PassThroughMergePolicy(com.hazelcast.spi.merge.PassThroughMergePolicy) ListenerConfig(com.hazelcast.config.ListenerConfig) JoinConfig(com.hazelcast.config.JoinConfig) Config(com.hazelcast.config.Config) NetworkConfig(com.hazelcast.config.NetworkConfig) NetworkConfig(com.hazelcast.config.NetworkConfig) JoinConfig(com.hazelcast.config.JoinConfig)

Aggregations

JoinConfig (com.hazelcast.config.JoinConfig)90 Config (com.hazelcast.config.Config)64 NetworkConfig (com.hazelcast.config.NetworkConfig)32 Test (org.junit.Test)32 TcpIpConfig (com.hazelcast.config.TcpIpConfig)27 QuickTest (com.hazelcast.test.annotation.QuickTest)20 InterfacesConfig (com.hazelcast.config.InterfacesConfig)18 HazelcastInstance (com.hazelcast.core.HazelcastInstance)18 MulticastConfig (com.hazelcast.config.MulticastConfig)15 PartitionGroupConfig (com.hazelcast.config.PartitionGroupConfig)15 DiscoveryConfig (com.hazelcast.config.DiscoveryConfig)13 SlowTest (com.hazelcast.test.annotation.SlowTest)12 DiscoveryStrategyConfig (com.hazelcast.config.DiscoveryStrategyConfig)11 RealmConfig (com.hazelcast.config.security.RealmConfig)11 ClientConfig (com.hazelcast.client.config.ClientConfig)9 ListenerConfig (com.hazelcast.config.ListenerConfig)8 AwsConfig (com.hazelcast.config.AwsConfig)7 MemberAttributeConfig (com.hazelcast.config.MemberAttributeConfig)7 ServerSocketEndpointConfig (com.hazelcast.config.ServerSocketEndpointConfig)6 CountDownLatch (java.util.concurrent.CountDownLatch)6