boolean sawSystemProperties = false;
boolean sawSocketBinding = false;
final Set<String> interfaceNames = new HashSet<String>();
while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
requireNamespace(reader, expectedNs);
final Element element = Element.forName(reader.getLocalName());
switch (element) {
case INTERFACES: { // THIS IS DIFFERENT FROM 1.0
parseInterfaces(reader, interfaceNames, serverAddress, expectedNs, list, true);
break;
}
case JVM: {
if (sawJvm) {
throw MESSAGES.alreadyDefined(element.getLocalName(), reader.getLocation());
}
JvmXml.parseJvm(reader, serverAddress, expectedNs, list, new HashSet<String>(), true);
sawJvm = true;
break;
}
case PATHS: {
parsePaths(reader, serverAddress, expectedNs, list, true);
break;
}
case SOCKET_BINDINGS: {
if (sawSocketBinding) {
throw MESSAGES.alreadyDefined(element.getLocalName(), reader.getLocation());
}
parseServerSocketBindings(reader, serverAddress, list);
sawSocketBinding = true;
break;
}
case SYSTEM_PROPERTIES: {
if (sawSystemProperties) {
throw MESSAGES.alreadyDefined(element.getLocalName(), reader.getLocation());
}
parseSystemProperties(reader, serverAddress, expectedNs, list, false);
sawSystemProperties = true;
break;
}