@Override public synchronized boolean cancel() { completed = true; if (future != null) future.cancelledResult(); if (sharedStream != null) { sharedStream.setException(new IOException("cancelled")); IOUtils.closeQuietly(sharedStream); } releaseResources(); return true; }
@Override public synchronized void failed(Exception ex) { completed = true; if (future != null) future.failed(clientException(ex, null)); if (sharedStream != null) { sharedStream.setException(ioException(ex)); IOUtils.closeQuietly(sharedStream); } releaseResources(); }
@Override public synchronized void responseCompleted(HttpContext context) { this.completed = true; try { if (sharedStream != null) { // only needed in case of empty response body (=null ioctrl) sharedStream.consumeContent(EndOfStream.INSTANCE, null); } } catch (IOException ioe) { // cannot happen throw new RuntimeException(ioe); } finally { releaseResources(); } }
completed = true; if (future != null) future.failed(exception); releaseResources();
completed = true; if (future != null) future.failed(exception); releaseResources();
@Override public synchronized void responseCompleted(HttpContext context) { this.completed = true; try { if (sharedStream != null) { // only needed in case of empty response body (=null ioctrl) sharedStream.consumeContent(EndOfStream.INSTANCE, null); } } catch (IOException ioe) { // cannot happen throw new RuntimeException(ioe); } finally { releaseResources(); } }
@Override public synchronized void responseCompleted(HttpContext context) { this.completed = true; try { if (sharedStream != null) { // only needed in case of empty response body (=null ioctrl) sharedStream.consumeContent(EndOfStream.INSTANCE, null); } } catch (IOException ioe) { // cannot happen throw new RuntimeException(ioe); } finally { releaseResources(); } }
@Override public synchronized void close() { completed = true; ResultFuture<T> future = this.future; if (future != null) { // if connect fails, then the httpclient just calls close() after setting its future, but never our failed(). // so copy the httpFuture-result into our ResultFuture. future.copyHttpFutureResult(); if (!future.isDone()) { // doesnt happen? future.failed(clientException(new IOException("connect failed"), null)); } } releaseResources(); }
@Override public synchronized void close() { completed = true; ResultFuture<T> future = this.future; if (future != null) { // if connect fails, then the httpclient just calls close() after setting its future, but never our failed(). // so copy the httpFuture-result into our ResultFuture. future.copyHttpFutureResult(); if (!future.isDone()) { // doesnt happen? future.failed(clientException(new IOException("connect failed"), null)); } } releaseResources(); }
@Override public synchronized boolean cancel() { completed = true; if (future != null) future.cancelledResult(); if (sharedStream != null) { sharedStream.setException(new IOException("cancelled")); IOUtils.closeQuietly(sharedStream); } releaseResources(); return true; }
@Override public synchronized boolean cancel() { completed = true; if (future != null) future.cancelledResult(); if (sharedStream != null) { sharedStream.setException(new IOException("cancelled")); IOUtils.closeQuietly(sharedStream); } releaseResources(); return true; }
@Override public synchronized void failed(Exception ex) { completed = true; if (future != null) future.failed(clientException(ex, null)); if (sharedStream != null) { sharedStream.setException(ioException(ex)); IOUtils.closeQuietly(sharedStream); } releaseResources(); }
@Override public synchronized void failed(Exception ex) { completed = true; if (future != null) future.failed(clientException(ex, null)); if (sharedStream != null) { sharedStream.setException(ioException(ex)); IOUtils.closeQuietly(sharedStream); } releaseResources(); }
completed = true; if (future != null) future.failed(exception); releaseResources();
@Override public synchronized void close() { completed = true; ResultFuture<T> future = this.future; if (future != null) { // if connect fails, then the httpclient just calls close() after setting its future, but never our failed(). // so copy the httpFuture-result into our ResultFuture. future.copyHttpFutureResult(); if (!future.isDone()) { // doesnt happen? future.failed(clientException(new IOException("connect failed"), null)); } } releaseResources(); }