Args.notNull(route, "HTTP route");
final HttpHost host = route.getTargetHost();
final Lookup<SchemeIOSessionStrategy> reg = getIOSessionFactoryRegistry(context);
final SchemeIOSessionStrategy sf = reg.lookup(host.getSchemeName());
if (sf == null) {
throw new UnsupportedSchemeException(host.getSchemeName() +
" protocol is not supported");
}
if (!sf.isLayeringRequired()) {
throw new UnsupportedSchemeException(host.getSchemeName() +
" protocol does not support connection upgrade");
}
synchronized (managedConn) {
final CPoolEntry entry = CPoolProxy.getPoolEntry(managedConn);
final ManagedNHttpClientConnection conn = entry.getConnection();