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