int managementInterfacesCount = 0;
final ModelNode managementAddress = address.clone().add(CORE_SERVICE, MANAGEMENT);
while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
requireNamespace(reader, expectedNs);
final Element element = Element.forName(reader.getLocalName());
switch (element) {
case SECURITY_REALMS: {
if (++securityRealmsCount > 1) {
throw unexpectedElement(reader);
}
parseSecurityRealms(reader, managementAddress, expectedNs, list);
break;
}
case OUTBOUND_CONNECTIONS: {
if (++connectionsCount > 1) {
throw unexpectedElement(reader);
}
parseConnections(reader, managementAddress, expectedNs, list);
break;
}
case MANAGEMENT_INTERFACES: {
if (allowInterfaces) {
if (++managementInterfacesCount > 1) {
throw unexpectedElement(reader);
}
delegate.parseManagementInterfaces(reader, managementAddress, expectedNs, list);
} else {
ROOT_LOGGER.warn(ParseUtils.getWarningMessage(MESSAGES.elementNotSupported(element.getLocalName(), "domain.xml"), reader.getLocation()));
}
break;
}
default: {
throw unexpectedElement(reader);