Package org.platformlayer.http.apache

Source Code of org.platformlayer.http.apache.InstrumentedApacheCommonsHttpConfiguration

package org.platformlayer.http.apache;

import org.apache.http.client.HttpClient;
import org.apache.http.conn.ClientConnectionManager;
import org.apache.http.conn.scheme.SchemeRegistry;
import org.apache.http.params.HttpParams;
import org.platformlayer.http.SslConfiguration;

import com.yammer.metrics.httpclient.InstrumentedClientConnManager;
import com.yammer.metrics.httpclient.InstrumentedHttpClient;

class InstrumentedApacheCommonsHttpConfiguration extends ApacheCommonsHttpConfiguration {
  InstrumentedApacheCommonsHttpConfiguration(SslConfiguration sslConfiguration) {
    super(sslConfiguration);
  }

  @Override
  protected ClientConnectionManager buildConnectionManager(SchemeRegistry schemeRegistry) {
    return new InstrumentedClientConnManager(schemeRegistry);
  }

  @Override
  protected HttpClient buildDefaultHttpClient(ClientConnectionManager connectionManager, HttpParams httpParams) {
    HttpClient httpClient = new InstrumentedHttpClient((InstrumentedClientConnManager) connectionManager,
        httpParams);
    return httpClient;
  }
}
TOP

Related Classes of org.platformlayer.http.apache.InstrumentedApacheCommonsHttpConfiguration

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.