Example usage for org.apache.http.protocol BasicHttpProcessor getResponseInterceptorCount

List of usage examples for org.apache.http.protocol BasicHttpProcessor getResponseInterceptorCount

Introduction

In this page you can find the example usage for org.apache.http.protocol BasicHttpProcessor getResponseInterceptorCount.

Prototype

public int getResponseInterceptorCount() 

Source Link

Usage

From source file:org.apache.http.impl.client.AbstractHttpClient.java

private synchronized HttpProcessor getProtocolProcessor() {
    if (protocolProcessor == null) {
        // Get mutable HTTP processor
        final BasicHttpProcessor proc = getHttpProcessor();
        // and create an immutable copy of it
        final int reqc = proc.getRequestInterceptorCount();
        final HttpRequestInterceptor[] reqinterceptors = new HttpRequestInterceptor[reqc];
        for (int i = 0; i < reqc; i++) {
            reqinterceptors[i] = proc.getRequestInterceptor(i);
        }/* w w w .ja  v  a 2s.com*/
        final int resc = proc.getResponseInterceptorCount();
        final HttpResponseInterceptor[] resinterceptors = new HttpResponseInterceptor[resc];
        for (int i = 0; i < resc; i++) {
            resinterceptors[i] = proc.getResponseInterceptor(i);
        }
        protocolProcessor = new ImmutableHttpProcessor(reqinterceptors, resinterceptors);
    }
    return protocolProcessor;
}

From source file:org.apache.http.impl.client.AbstractStatisticsGatheringHttpClient.java

private synchronized final HttpProcessor getProtocolProcessor() {
    if (protocolProcessor == null) {
        // Get mutable HTTP processor
        BasicHttpProcessor proc = getHttpProcessor();
        // and create an immutable copy of it
        int reqc = proc.getRequestInterceptorCount();
        HttpRequestInterceptor[] reqinterceptors = new HttpRequestInterceptor[reqc];
        for (int i = 0; i < reqc; i++) {
            reqinterceptors[i] = proc.getRequestInterceptor(i);
        }/*from   w  w w . j a v  a 2  s .c o  m*/
        int resc = proc.getResponseInterceptorCount();
        HttpResponseInterceptor[] resinterceptors = new HttpResponseInterceptor[resc];
        for (int i = 0; i < resc; i++) {
            resinterceptors[i] = proc.getResponseInterceptor(i);
        }
        protocolProcessor = new ImmutableHttpProcessor(reqinterceptors, resinterceptors);
    }
    return protocolProcessor;
}

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

private synchronized final HttpProcessor getProtocolProcessor() {
    if (this.protocolProcessor == null) {
        // Get mutable HTTP processor
        final BasicHttpProcessor proc = getHttpProcessor();
        // and upgrade an immutable copy of it
        final int reqc = proc.getRequestInterceptorCount();
        final HttpRequestInterceptor[] reqinterceptors = new HttpRequestInterceptor[reqc];
        for (int i = 0; i < reqc; i++) {
            reqinterceptors[i] = proc.getRequestInterceptor(i);
        }//from  w  w w  . java 2  s.  com
        final int resc = proc.getResponseInterceptorCount();
        final HttpResponseInterceptor[] resinterceptors = new HttpResponseInterceptor[resc];
        for (int i = 0; i < resc; i++) {
            resinterceptors[i] = proc.getResponseInterceptor(i);
        }
        this.protocolProcessor = new ImmutableHttpProcessor(reqinterceptors, resinterceptors);
    }
    return this.protocolProcessor;
}