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

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

Introduction

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

Prototype

public void close() throws IOException;

Source Link

Document

Closes this stream and releases any system resources associated with it.

Usage

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

private void closeProducer(final HttpAsyncRequestProducer requestProducer) {
    if (requestProducer != null) {
        try {/*from www  .  ja v a  2  s  .c o  m*/
            requestProducer.close();
        } catch (final IOException ex) {
            this.log.debug("I/O error closing request producer", ex);
        }
    }
}

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");
    }/*  w w  w  .j ava  2  s .  c om*/
    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);
    }
}