public void abortConnection() { if (aborted) { return; } aborted = true; unmarkReusable(); try { shutdown(); } catch (IOException ignore) { } // Usually #abortConnection() is expected to be called from // a helper thread in order to unblock the main execution thread // blocked in an I/O operation. It may be unsafe to call // #releaseConnection() from the helper thread, so we have to rely // on an IOException thrown by the closed socket on the main thread // to trigger the release of the connection back to the // connection manager. // // However, if this method is called from the main execution thread // it should be safe to release the connection immediately. Besides, // this also helps ensure the connection gets released back to the // manager if #abortConnection() is called from the main execution // thread while there is no blocking I/O operation. if (executionThread.equals(Thread.currentThread())) { releaseConnection(); } }
public synchronized void abortConnection() { if (released) { return; } released = true; unmarkReusable(); try { shutdown(); } catch (final IOException ignore) { } connManager.releaseConnection(this, duration, TimeUnit.MILLISECONDS); }
public synchronized void abortConnection() { if (released) { return; } released = true; unmarkReusable(); try { shutdown(); } catch (final IOException ignore) { } connManager.releaseConnection(this, duration, TimeUnit.MILLISECONDS); }
@Override public synchronized void abortConnection() { if (released) { return; } released = true; unmarkReusable(); try { shutdown(); } catch (final IOException ignore) { } connManager.releaseConnection(this, duration, TimeUnit.MILLISECONDS); }
@Override public synchronized void abortConnection() { if (released) { return; } released = true; unmarkReusable(); try { shutdown(); } catch (final IOException ignore) { } connManager.releaseConnection(this, duration, TimeUnit.MILLISECONDS); }
public void abortConnection() { if (aborted) { return; } aborted = true; unmarkReusable(); try { shutdown(); } catch (IOException ignore) { } // Usually #abortConnection() is expected to be called from // a helper thread in order to unblock the main execution thread // blocked in an I/O operation. It may be unsafe to call // #releaseConnection() from the helper thread, so we have to rely // on an IOException thrown by the closed socket on the main thread // to trigger the release of the connection back to the // connection manager. // // However, if this method is called from the main execution thread // it should be safe to release the connection immediately. Besides, // this also helps ensure the connection gets released back to the // manager if #abortConnection() is called from the main execution // thread while there is no blocking I/O operation. if (executionThread.equals(Thread.currentThread())) { releaseConnection(); } }
public void abortConnection() { if (aborted) { return; } aborted = true; unmarkReusable(); try { shutdown(); } catch (IOException ignore) { } // Usually #abortConnection() is expected to be called from // a helper thread in order to unblock the main execution thread // blocked in an I/O operation. It may be unsafe to call // #releaseConnection() from the helper thread, so we have to rely // on an IOException thrown by the closed socket on the main thread // to trigger the release of the connection back to the // connection manager. // // However, if this method is called from the main execution thread // it should be safe to release the connection immediately. Besides, // this also helps ensure the connection gets released back to the // manager if #abortConnection() is called from the main execution // thread while there is no blocking I/O operation. if (executionThread.equals(Thread.currentThread())) { releaseConnection(); } }
public void abortConnection() { if (aborted) { return; } aborted = true; unmarkReusable(); try { shutdown(); } catch (IOException ignore) { } // Usually #abortConnection() is expected to be called from // a helper thread in order to unblock the main execution thread // blocked in an I/O operation. It may be unsafe to call // #releaseConnection() from the helper thread, so we have to rely // on an IOException thrown by the closed socket on the main thread // to trigger the release of the connection back to the // connection manager. // // However, if this method is called from the main execution thread // it should be safe to release the connection immediately. Besides, // this also helps ensure the connection gets released back to the // manager if #abortConnection() is called from the main execution // thread while there is no blocking I/O operation. if (executionThread.equals(Thread.currentThread())) { releaseConnection(); } }
public void abortConnection() { if (aborted) { return; } aborted = true; unmarkReusable(); try { shutdown(); } catch (IOException ignore) { } // Usually #abortConnection() is expected to be called from // a helper thread in order to unblock the main execution thread // blocked in an I/O operation. It may be unsafe to call // #releaseConnection() from the helper thread, so we have to rely // on an IOException thrown by the closed socket on the main thread // to trigger the release of the connection back to the // connection manager. // // However, if this method is called from the main execution thread // it should be safe to release the connection immediately. Besides, // this also helps ensure the connection gets released back to the // manager if #abortConnection() is called from the main execution // thread while there is no blocking I/O operation. if (executionThread.equals(Thread.currentThread())) { releaseConnection(); } }