public void releaseConnection() { if (connManager != null) { connManager.releaseConnection(this, duration, TimeUnit.MILLISECONDS); } }
public HttpHostConnectException(final HttpHost host, final ConnectException cause) { super("Connection to " + host + " refused"); this.host = host; initCause(cause); }
public void abortConnection() throws IOException { if (managedConn != null) { try { managedConn.abortConnection(); } finally { managedConn = null; } } }
/** * Release any system resources held by this instance. * * @see ClientConnectionManager#shutdown() */ public void shutdown() { client.getConnectionManager().shutdown(); }
@Override public void closeIdleConnections(long idletime, TimeUnit tunit) { this.fallbackConnManager.closeIdleConnections(idletime, tunit); }
@Override public void closeExpiredConnections() { this.fallbackConnManager.closeExpiredConnections(); }
@Override public void shutdown() { this.fallbackConnManager.shutdown(); }
public boolean eofDetected(InputStream wrapped) throws IOException { try { if (attemptReuse && (managedConn != null)) { // there may be some cleanup required, such as // reading trailers after the response body: wrapped.close(); managedConn.markReusable(); } } finally { releaseManagedConnection(); } return false; }
@Override public ConnectionRequest requestConnection(HttpRoute route, Object state) { return this.fallbackConnManager.requestConnection(route, state); }
@Override public void close() throws IOException { // tolerate multiple calls to close() selfClosed = true; checkClose(); }
/** * Same as {@link #close close()}. */ public void releaseConnection() throws IOException { this.close(); }
/** * Aborts this stream. * This is a special version of {@link #close close()} which prevents * re-use of the underlying connection, if any. Calling this method * indicates that there should be no attempt to read until the end of * the stream. */ public void abortConnection() throws IOException { // tolerate multiple calls selfClosed = true; checkAbort(); }
@Override public void connect(HttpClientConnection conn, HttpRoute route, int connectTimeout, HttpContext context) throws IOException { this.fallbackConnManager.connect(conn, route, connectTimeout, context); }
@Override public void upgrade(HttpClientConnection conn, HttpRoute route, HttpContext context) throws IOException { this.fallbackConnManager.upgrade(conn, route, context); }
@Override public void routeComplete(HttpClientConnection conn, HttpRoute route, HttpContext context) throws IOException { this.fallbackConnManager.routeComplete(conn, route, context); }
@Override public void releaseConnection(HttpClientConnection conn, Object newState, long validDuration, TimeUnit timeUnit) { this.fallbackConnManager.releaseConnection(conn, newState, validDuration, timeUnit); }
public void releaseConnection() throws IOException { this.consumeContent(); }
@Override public void consumeContent() throws IOException { if (managedConn == null) return; try { if (attemptReuse) { // this will not trigger a callback from EofSensorInputStream wrappedEntity.consumeContent(); managedConn.markReusable(); } } finally { releaseManagedConnection(); } }
public boolean streamAbort(InputStream wrapped) throws IOException { if (managedConn != null) { managedConn.abortConnection(); } return false; }
public boolean streamAbort(InputStream wrapped) throws IOException { managedConn.abortConnection(); return false; }