/** * Releases the connection gracefully. * The connection attribute will be nullified. * Subsequent invocations are no-ops. * * @throws IOException in case of an IO problem. * The connection attribute will be nullified anyway. */ protected void releaseManagedConnection() throws IOException { if (managedConn != null) { try { managedConn.releaseConnection(); } finally { managedConn = null; } } }
/** * Returns the connection back to the connection manager * and prepares for retrieving a new connection during * the next request. */ protected void releaseConnection() { // Release the connection through the ManagedConnection instead of the // ConnectionManager directly. This lets the connection control how // it is released. try { managedConn.releaseConnection(); } catch(IOException ignored) { this.log.debug("IOException releasing connection", ignored); } managedConn = null; }
/** * Returns the connection back to the connection manager * and prepares for retrieving a new connection during * the next request. */ protected void releaseConnection() { // Release the connection through the ManagedConnection instead of the // ConnectionManager directly. This lets the connection control how // it is released. try { managedConn.releaseConnection(); } catch(IOException ignored) { this.log.debug("IOException releasing connection", ignored); } managedConn = null; }
public boolean eofDetected(InputStream wrapped) throws IOException { try { if (attemptReuse) { // there may be some cleanup required, such as // reading trailers after the response body: wrapped.close(); managedConn.markReusable(); } } finally { managedConn.releaseConnection(); } return false; }
public boolean streamClosed(InputStream wrapped) throws IOException { try { if (attemptReuse) { // this assumes that closing the stream will // consume the remainder of the response body: wrapped.close(); managedConn.markReusable(); } } finally { managedConn.releaseConnection(); } return false; }
/** * Shuts down the connection. * This method is called from a {@code catch} block in * {@link #execute execute} during exception handling. */ private void abortConnection() { ManagedClientConnection mcc = managedConn; if (mcc != null) { // we got here as the result of an exception // no response will be returned, release the connection managedConn = null; try { mcc.abortConnection(); } catch (IOException ex) { if (this.log.isDebugEnabled()) { this.log.debug(ex.getMessage(), ex); } } // ensure the connection manager properly releases this connection try { mcc.releaseConnection(); } catch(IOException ignored) { this.log.debug("Error releasing connection", ignored); } } } // abortConnection
/** * Shuts down the connection. * This method is called from a <code>catch</code> block in * {@link #execute execute} during exception handling. */ private void abortConnection() { ManagedClientConnection mcc = managedConn; if (mcc != null) { // we got here as the result of an exception // no response will be returned, release the connection managedConn = null; try { mcc.abortConnection(); } catch (IOException ex) { if (this.log.isDebugEnabled()) { this.log.debug(ex.getMessage(), ex); } } // ensure the connection manager properly releases this connection try { mcc.releaseConnection(); } catch(IOException ignored) { this.log.debug("Error releasing connection", ignored); } } } // abortConnection
/** * Returns the connection back to the connection manager * and prepares for retrieving a new connection during * the next request. */ protected void releaseConnection() { // Release the connection through the ManagedConnection instead of the // ConnectionManager directly. This lets the connection control how // it is released. try { managedConn.releaseConnection(); } catch(IOException ignored) { this.log.debug("IOException releasing connection", ignored); } managedConn = null; }
/** * Returns the connection back to the connection manager * and prepares for retrieving a new connection during * the next request. */ protected void releaseConnection() { // Release the connection through the ManagedConnection instead of the // ConnectionManager directly. This lets the connection control how // it is released. try { managedConn.releaseConnection(); } catch(IOException ignored) { this.log.debug("IOException releasing connection", ignored); } managedConn = null; }
/** * Returns the connection back to the connection manager * and prepares for retrieving a new connection during * the next request. */ protected void releaseConnection() { // Release the connection through the ManagedConnection instead of the // ConnectionManager directly. This lets the connection control how // it is released. try { managedConn.releaseConnection(); } catch(IOException ignored) { this.log.debug("IOException releasing connection", ignored); } managedConn = null; }
/** * Returns the connection back to the connection manager * and prepares for retrieving a new connection during * the next request. */ protected void releaseConnection() { // Release the connection through the ManagedConnection instead of the // ConnectionManager directly. This lets the connection control how // it is released. try { managedConn.releaseConnection(); } catch(final IOException ignored) { this.log.debug("IOException releasing connection", ignored); } managedConn = null; }
/** * Returns the connection back to the connection manager * and prepares for retrieving a new connection during * the next request. */ protected void releaseConnection() { // Release the connection through the ManagedConnection instead of the // ConnectionManager directly. This lets the connection control how // it is released. try { managedConn.releaseConnection(); } catch(final IOException ignored) { this.log.debug("IOException releasing connection", ignored); } managedConn = null; }
public boolean streamClosed(InputStream wrapped) throws IOException { try { if (attemptReuse) { // this assumes that closing the stream will // consume the remainder of the response body: wrapped.close(); managedConn.markReusable(); } } finally { managedConn.releaseConnection(); } return false; }
public boolean streamClosed(InputStream wrapped) throws IOException { try { if (attemptReuse) { // this assumes that closing the stream will // consume the remainder of the response body: wrapped.close(); managedConn.markReusable(); } } finally { managedConn.releaseConnection(); } return false; }
@Override public boolean eofDetected(final InputStream wrapped) throws IOException { try { if (attemptReuse) { // there may be some cleanup required, such as // reading trailers after the response body: wrapped.close(); managedConn.markReusable(); } } finally { managedConn.releaseConnection(); } return false; }
@Override public boolean eofDetected(final InputStream wrapped) throws IOException { try { if (attemptReuse) { // there may be some cleanup required, such as // reading trailers after the response body: wrapped.close(); managedConn.markReusable(); } } finally { managedConn.releaseConnection(); } return false; }
public boolean eofDetected(InputStream wrapped) throws IOException { try { if (attemptReuse) { // there may be some cleanup required, such as // reading trailers after the response body: wrapped.close(); managedConn.markReusable(); } } finally { managedConn.releaseConnection(); } return false; }
public boolean eofDetected(InputStream wrapped) throws IOException { try { if (attemptReuse) { // there may be some cleanup required, such as // reading trailers after the response body: wrapped.close(); managedConn.markReusable(); } } finally { managedConn.releaseConnection(); } return false; }
public boolean streamClosed(InputStream wrapped) throws IOException { try { if (attemptReuse) { // this assumes that closing the stream will // consume the remainder of the response body: wrapped.close(); managedConn.markReusable(); } } finally { managedConn.releaseConnection(); } return false; }
public boolean eofDetected(InputStream wrapped) throws IOException { try { if (attemptReuse) { // there may be some cleanup required, such as // reading trailers after the response body: wrapped.close(); managedConn.markReusable(); } } finally { managedConn.releaseConnection(); } return false; }