Search in sources :

Example 6 with HttpAsyncRequestProducer

use of org.apache.http.nio.protocol.HttpAsyncRequestProducer in project pinpoint by naver.

the class DefaultClientExchangeHandlerImplStartMethodInterceptor method getHost.

private NameIntValuePair<String> getHost(final Object target) {
    if (!(target instanceof RequestProducerGetter)) {
        return null;
    }
    final HttpAsyncRequestProducer producer = ((RequestProducerGetter) target)._$PINPOINT$_getRequestProducer();
    final HttpHost httpHost = producer.getTarget();
    if (httpHost != null) {
        return new NameIntValuePair<String>(httpHost.getHostName(), httpHost.getPort());
    } else {
        return null;
    }
}
Also used : NameIntValuePair(com.navercorp.pinpoint.bootstrap.pair.NameIntValuePair) RequestProducerGetter(com.navercorp.pinpoint.plugin.httpclient4.RequestProducerGetter) HttpAsyncRequestProducer(org.apache.http.nio.protocol.HttpAsyncRequestProducer) HttpHost(org.apache.http.HttpHost)

Aggregations

HttpAsyncRequestProducer (org.apache.http.nio.protocol.HttpAsyncRequestProducer)6 HttpResponse (org.apache.http.HttpResponse)5 HttpClientContext (org.apache.http.client.protocol.HttpClientContext)5 HttpHost (org.apache.http.HttpHost)4 FutureCallback (org.apache.http.concurrent.FutureCallback)4 BasicHttpResponse (org.apache.http.message.BasicHttpResponse)4 HttpAsyncResponseConsumer (org.apache.http.nio.protocol.HttpAsyncResponseConsumer)4 Future (java.util.concurrent.Future)3 HttpEntityEnclosingRequest (org.apache.http.HttpEntityEnclosingRequest)3 ProtocolVersion (org.apache.http.ProtocolVersion)3 StatusLine (org.apache.http.StatusLine)3 HttpUriRequest (org.apache.http.client.methods.HttpUriRequest)3 CloseableHttpAsyncClient (org.apache.http.impl.nio.client.CloseableHttpAsyncClient)3 BasicStatusLine (org.apache.http.message.BasicStatusLine)3 InvocationOnMock (org.mockito.invocation.InvocationOnMock)3 IOException (java.io.IOException)2 SocketTimeoutException (java.net.SocketTimeoutException)2 HttpEntity (org.apache.http.HttpEntity)2 ConnectTimeoutException (org.apache.http.conn.ConnectTimeoutException)2 Before (org.junit.Before)2