ParseUtils.requireNoContent(reader);
}
private void parseGlobal(final XMLExtendedStreamReader reader, final ConfigurationBuilderHolder holder) throws XMLStreamException {
GlobalConfigurationBuilder builder = holder.getGlobalConfigurationBuilder();
ParseUtils.requireNoAttributes(reader);
boolean transportParsed = false;
while (reader.hasNext() && (reader.nextTag() != XMLStreamConstants.END_ELEMENT)) {
Element element = Element.forName(reader.getLocalName());
switch (element) {
case ASYNC_LISTENER_EXECUTOR: {
parseAsyncListenerExecutor(reader, holder);
break;
}
case ASYNC_TRANSPORT_EXECUTOR: {
parseAsyncTransportExecutor(reader, holder);
break;
}
case EVICTION_SCHEDULED_EXECUTOR: {
parseEvictionScheduledExecutor(reader, holder);
break;
}
case GLOBAL_JMX_STATISTICS: {
parseGlobalJMXStatistics(reader, holder);
break;
}
case MODULES: {
parseModules(reader, holder);
break;
}
case REPLICATION_QUEUE_SCHEDULED_EXECUTOR: {
parseReplicationQueueScheduledExecutor(reader, holder);
break;
}
case SERIALIZATION: {
parseSerialization(reader, holder);
break;
}
case SHUTDOWN: {
parseShutdown(reader, holder);
break;
}
case TRANSPORT: {
parseTransport(reader, holder);
transportParsed = true;
break;
} case SITES: {
parseGlobalSites(reader, holder);
break;
}
default: {
throw ParseUtils.unexpectedElement(reader);
}
}
}
if (!transportParsed) {
// make sure there is no "default" transport
builder.transport().transport(null);
} else {
// The transport *has* been parsed. If we don't have a transport set, make sure we set the default.
if (builder.transport().getTransport() == null) {
builder.transport().defaultTransport();
}
}
}