config = newConfig;
}
final ActionReport report = context.getActionReport();
NetworkConfig networkConfig = config.getNetworkConfig();
Protocols protocols = networkConfig.getProtocols();
Protocol protocol = null;
for (Protocol p : protocols.getProtocol()) {
if (protocolName.equalsIgnoreCase(p.getName())) {
protocol = p;
}
}
if (protocol == null) {
report.setMessage(String.format("Unable to find protocol %s.", protocolName));
report.setActionExitCode(ActionReport.ExitCode.FAILURE);
return;
}
final Http http = protocol.getHttp();
if (http == null) {
report.setMessage(String.format("Protocol, %s, is not an HTTP enabled protocol.", protocolName));
report.setActionExitCode(ActionReport.ExitCode.FAILURE);
return;
}
try {
final String strategyName = SameThreadIOStrategy.class.getName();
Transport spdyTransport = null;
final List<NetworkListener> networkListeners =
protocol.findNetworkListeners();
for (NetworkListener networkListener : networkListeners) {
final Transport transport = networkListener.findTransport();
if (transport != null &&
!strategyName.equals(transport.getIoStrategy())) {
if (spdyTransport == null) {