Example usage for org.apache.http.nio.protocol HttpAsyncResponseConsumer cancel

List of usage examples for org.apache.http.nio.protocol HttpAsyncResponseConsumer cancel

Introduction

In this page you can find the example usage for org.apache.http.nio.protocol HttpAsyncResponseConsumer cancel.

Prototype

boolean cancel();

Source Link

Usage

From source file:org.apache.http.impl.nio.client.PipeliningClientExchangeHandlerImpl.java

@Override
void executionFailed(final Exception ex) {
    final HttpAsyncRequestProducer requestProducer = this.requestProducerRef.get();
    if (requestProducer != null) {
        requestProducer.failed(ex);/*from w  w w  .ja  va  2  s  .co  m*/
    }
    final HttpAsyncResponseConsumer<T> responseConsumer = this.responseConsumerRef.get();
    if (responseConsumer != null) {
        responseConsumer.failed(ex);
    }
    for (final HttpAsyncResponseConsumer<T> cancellable : this.responseConsumerQueue) {
        cancellable.cancel();
    }
}

From source file:org.apache.http.impl.nio.client.PipeliningClientExchangeHandlerImpl.java

@Override
boolean executionCancelled() {
    final HttpAsyncResponseConsumer<T> responseConsumer = this.responseConsumerRef.get();
    final boolean cancelled = responseConsumer != null && responseConsumer.cancel();
    this.resultFuture.cancel();
    return cancelled;
}