Example usage for org.apache.http.conn.params ConnManagerParamBean setMaxTotalConnections

List of usage examples for org.apache.http.conn.params ConnManagerParamBean setMaxTotalConnections

Introduction

In this page you can find the example usage for org.apache.http.conn.params ConnManagerParamBean setMaxTotalConnections.

Prototype

public void setMaxTotalConnections(final int maxConnections) 

Source Link

Usage

From source file:org.apache.camel.component.http4.HttpComponent.java

protected ClientConnectionManager createConnectionManager() {
    SchemeRegistry schemeRegistry = new SchemeRegistry();

    // configure additional configurations
    HttpParams params = new BasicHttpParams();
    ConnManagerParamBean param = new ConnManagerParamBean(params);
    if (getMaxTotalConnections() > 0) {
        param.setMaxTotalConnections(getMaxTotalConnections());
    }// w  w w  .j  a v  a 2  s .  c o  m
    if (getConnectionsPerRoute() > 0) {
        param.setConnectionsPerRoute(new ConnPerRouteBean(getConnectionsPerRoute()));
    }

    ThreadSafeClientConnManager answer = new ThreadSafeClientConnManager(params, schemeRegistry);
    LOG.info("Created ClientConnectionManager " + answer);

    return answer;
}