use of org.apache.http.impl.conn.ConnectionShutdownException in project jmeter by apache.
the class ManagedClientConnectionImpl method open.
@Override
public void open(final HttpRoute route, final HttpContext context, final HttpParams params) throws IOException {
Args.notNull(route, "Route");
Args.notNull(params, "HTTP parameters");
final OperatedClientConnection conn;
synchronized (this) {
if (this.poolEntry == null) {
throw new ConnectionShutdownException();
}
final RouteTracker tracker = this.poolEntry.getTracker();
Asserts.notNull(tracker, "Route tracker");
Asserts.check(!tracker.isConnected(), "Connection already open");
conn = this.poolEntry.getConnection();
}
final HttpHost proxy = route.getProxyHost();
this.operator.openConnection(conn, (proxy != null) ? proxy : route.getTargetHost(), route.getLocalAddress(), context, params);
synchronized (this) {
if (this.poolEntry == null) {
throw new InterruptedIOException();
}
final RouteTracker tracker = this.poolEntry.getTracker();
if (proxy == null) {
tracker.connectTarget(conn.isSecure());
} else {
tracker.connectProxy(proxy, conn.isSecure());
}
}
}
use of org.apache.http.impl.conn.ConnectionShutdownException in project jmeter by apache.
the class ManagedClientConnectionImpl method tunnelTarget.
@Override
public void tunnelTarget(final boolean secure, final HttpParams params) throws IOException {
Args.notNull(params, "HTTP parameters");
final HttpHost target;
final OperatedClientConnection conn;
synchronized (this) {
if (this.poolEntry == null) {
throw new ConnectionShutdownException();
}
final RouteTracker tracker = this.poolEntry.getTracker();
Asserts.notNull(tracker, "Route tracker");
Asserts.check(tracker.isConnected(), "Connection not open");
Asserts.check(!tracker.isTunnelled(), "Connection is already tunnelled");
target = tracker.getTargetHost();
conn = this.poolEntry.getConnection();
}
conn.update(null, target, secure, params);
synchronized (this) {
if (this.poolEntry == null) {
throw new InterruptedIOException();
}
final RouteTracker tracker = this.poolEntry.getTracker();
tracker.tunnelTarget(secure);
}
}
use of org.apache.http.impl.conn.ConnectionShutdownException in project jmeter by apache.
the class ManagedClientConnectionImpl method tunnelProxy.
@Override
public void tunnelProxy(final HttpHost next, final boolean secure, final HttpParams params) throws IOException {
Args.notNull(next, "Next proxy");
Args.notNull(params, "HTTP parameters");
final OperatedClientConnection conn;
synchronized (this) {
if (this.poolEntry == null) {
throw new ConnectionShutdownException();
}
final RouteTracker tracker = this.poolEntry.getTracker();
Asserts.notNull(tracker, "Route tracker");
Asserts.check(tracker.isConnected(), "Connection not open");
conn = this.poolEntry.getConnection();
}
conn.update(null, next, secure, params);
synchronized (this) {
if (this.poolEntry == null) {
throw new InterruptedIOException();
}
final RouteTracker tracker = this.poolEntry.getTracker();
tracker.tunnelProxy(next, secure);
}
}
use of org.apache.http.impl.conn.ConnectionShutdownException in project jmeter by apache.
the class ManagedClientConnectionImpl method layerProtocol.
@Override
public void layerProtocol(final HttpContext context, final HttpParams params) throws IOException {
Args.notNull(params, "HTTP parameters");
final HttpHost target;
final OperatedClientConnection conn;
synchronized (this) {
if (this.poolEntry == null) {
throw new ConnectionShutdownException();
}
final RouteTracker tracker = this.poolEntry.getTracker();
Asserts.notNull(tracker, "Route tracker");
Asserts.check(tracker.isConnected(), "Connection not open");
Asserts.check(tracker.isTunnelled(), "Protocol layering without a tunnel not supported");
Asserts.check(!tracker.isLayered(), "Multiple protocol layering not supported");
target = tracker.getTargetHost();
conn = this.poolEntry.getConnection();
}
this.operator.updateSecureConnection(conn, target, context, params);
synchronized (this) {
if (this.poolEntry == null) {
throw new InterruptedIOException();
}
final RouteTracker tracker = this.poolEntry.getTracker();
tracker.layerProtocol(conn.isSecure());
}
}
Aggregations