Search in sources :

Example 1 with MemberGroupType

use of com.hazelcast.config.PartitionGroupConfig.MemberGroupType in project hazelcast by hazelcast.

the class XmlConfigBuilder method handlePartitionGroup.

private void handlePartitionGroup(Node node) {
    NamedNodeMap atts = node.getAttributes();
    Node enabledNode = atts.getNamedItem("enabled");
    boolean enabled = enabledNode != null ? getBooleanValue(getTextContent(enabledNode)) : false;
    config.getPartitionGroupConfig().setEnabled(enabled);
    Node groupTypeNode = atts.getNamedItem("group-type");
    MemberGroupType groupType = groupTypeNode != null ? MemberGroupType.valueOf(upperCaseInternal(getTextContent(groupTypeNode))) : MemberGroupType.PER_MEMBER;
    config.getPartitionGroupConfig().setGroupType(groupType);
    for (Node child : childElements(node)) {
        if ("member-group".equals(cleanNodeName(child))) {
            handleMemberGroup(child);
        }
    }
}
Also used : NamedNodeMap(org.w3c.dom.NamedNodeMap) Node(org.w3c.dom.Node) MemberGroupType(com.hazelcast.config.PartitionGroupConfig.MemberGroupType)

Example 2 with MemberGroupType

use of com.hazelcast.config.PartitionGroupConfig.MemberGroupType in project hazelcast by hazelcast.

the class MemberDomConfigProcessor method handlePartitionGroup.

private void handlePartitionGroup(Node node) {
    Node enabledNode = getNamedItemNode(node, "enabled");
    boolean enabled = enabledNode != null && getBooleanValue(getTextContent(enabledNode));
    config.getPartitionGroupConfig().setEnabled(enabled);
    Node groupTypeNode = getNamedItemNode(node, "group-type");
    MemberGroupType groupType = groupTypeNode != null ? PartitionGroupConfig.MemberGroupType.valueOf(upperCaseInternal(getTextContent(groupTypeNode))) : PartitionGroupConfig.MemberGroupType.PER_MEMBER;
    config.getPartitionGroupConfig().setGroupType(groupType);
    for (Node child : childElements(node)) {
        if (matches("member-group", cleanNodeName(child))) {
            handleMemberGroup(child, config);
        }
    }
}
Also used : Node(org.w3c.dom.Node) MemberGroupType(com.hazelcast.config.PartitionGroupConfig.MemberGroupType)

Aggregations

MemberGroupType (com.hazelcast.config.PartitionGroupConfig.MemberGroupType)2 Node (org.w3c.dom.Node)2 NamedNodeMap (org.w3c.dom.NamedNodeMap)1