@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 boolean cancel() { completed = true; if (future != null) future.cancelledResult(); if (sharedStream != null) { sharedStream.setException(new IOException("cancelled")); IOUtils.closeQuietly(sharedStream); } releaseResources(); return true; }
if (entity != null) sharedStream = new SharedInputStream(new SharedInputBuffer(16 * 1024)); sharedStream.setException(unallowedBlockingReadException); result = extractor.extractResult(clientResponse); sharedStream.setException(null);
if (entity != null) sharedStream = new SharedInputStream(new SharedInputBuffer(16 * 1024)); sharedStream.setException(unallowedBlockingReadException); result = extractor.extractResult(clientResponse); sharedStream.setException(null);
@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 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 consumeContent(ContentDecoder decoder, IOControl ioctrl) throws IOException { if (sharedStream != null) sharedStream.consumeContent(decoder, ioctrl); }
@Override public synchronized void consumeContent(ContentDecoder decoder, IOControl ioctrl) throws IOException { if (sharedStream != null) sharedStream.consumeContent(decoder, ioctrl); }
@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(); }
if (entity != null) sharedStream = new SharedInputStream(new SharedInputBuffer(16 * 1024)); sharedStream.setException(unallowedBlockingReadException); result = extractor.extractResult(clientResponse); sharedStream.setException(null);
@Override public synchronized void consumeContent(ContentDecoder decoder, IOControl ioctrl) throws IOException { if (sharedStream != null) sharedStream.consumeContent(decoder, ioctrl); }
@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(); }