Example usage for org.apache.http.nio.protocol HttpAsyncRequestProducer requestCompleted

List of usage examples for org.apache.http.nio.protocol HttpAsyncRequestProducer requestCompleted

Introduction

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

Prototype

void requestCompleted(HttpContext context);

Source Link

Document

Invoked to signal that the request has been fully written out.

Usage

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

@Override
public void requestCompleted(final InternalState state, final AbstractClientExchangeHandler<?> handler) {
    if (this.log.isDebugEnabled()) {
        this.log.debug("[exchange: " + state.getId() + "] Request completed");
    }//from  www .j  av  a2 s . c  om
    final HttpClientContext localContext = state.getLocalContext();
    final HttpAsyncRequestProducer requestProducer = state.getRequestProducer();
    requestProducer.requestCompleted(localContext);
}

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

@Override
public void requestCompleted() {
    if (this.log.isDebugEnabled()) {
        this.log.debug("[exchange: " + getId() + "] Request completed");
    }//from w  w w . j a va 2s  .  c  o m
    final HttpAsyncRequestProducer requestProducer = this.requestProducerRef.getAndSet(null);
    Asserts.check(requestProducer != null, "Inconsistent state: request producer is null");
    requestProducer.requestCompleted(this.localContext);
    try {
        requestProducer.close();
    } catch (final IOException ioex) {
        this.log.debug(ioex.getMessage(), ioex);
    }
}