use of org.eclipse.scout.rt.shared.http.ApacheHttpTransportFactory.ApacheHttpTransportBuilder in project scout.rt by eclipse.
the class HttpServiceTunnelTransportManager method interceptNewHttpTransport.
@Override
public void interceptNewHttpTransport(IHttpTransportBuilder builder0) {
super.interceptNewHttpTransport(builder0);
if (builder0 instanceof ApacheHttpTransportBuilder) {
ApacheHttpTransportBuilder builder = (ApacheHttpTransportBuilder) builder0;
if (builder.getConnectionManager() != null && builder.getConnectionManager() instanceof PoolingHttpClientConnectionManager) {
@SuppressWarnings("resource") PoolingHttpClientConnectionManager cm = (PoolingHttpClientConnectionManager) builder.getConnectionManager();
cm.setDefaultMaxPerRoute(CONFIG.getPropertyValue(HttpServiceTunnelTransportMaxConnectionsPerRouteProperty.class));
cm.setMaxTotal(CONFIG.getPropertyValue(HttpServiceTunnelTransportMaxConnectionsTotalProperty.class));
} else {
builder.getBuilder().setMaxConnPerRoute(CONFIG.getPropertyValue(HttpServiceTunnelTransportMaxConnectionsPerRouteProperty.class));
builder.getBuilder().setMaxConnTotal(CONFIG.getPropertyValue(HttpServiceTunnelTransportMaxConnectionsTotalProperty.class));
}
}
}
Aggregations