Java 类org.apache.http.impl.conn.DefaultHttpClientConnectionOperator 实例源码

项目:nexus-public    文件:SharedHttpClientConnectionManager.java   
@Inject
public SharedHttpClientConnectionManager(
    final List<SSLContextSelector> sslContextSelectors,
    @Named("${nexus.httpclient.connectionpool.size:-20}") final int connectionPoolSize,
    @Named("${nexus.httpclient.connectionpool.maxSize:-200}") final int connectionPoolMaxSize,
    @Named("${nexus.httpclient.connectionpool.idleTime:-30s}") final Time connectionPoolIdleTime,
    @Named("${nexus.httpclient.connectionpool.evictingDelayTime:-5s}") final Time connectionPoolEvictingDelayTime,
    @Named("${nexus.httpclient.connectionpool.validateAfterInactivityTime:-2s}") final Time connectionPoolValidateAfterInactivityTime)
{
  super(
      new DefaultHttpClientConnectionOperator(createRegistry(sslContextSelectors), null, null),
      null,
      connectionPoolIdleTime.toMillis(),
      TimeUnit.MILLISECONDS
  );

  setMaxTotal(connectionPoolMaxSize);
  log.debug("Connection pool max-size: {}", connectionPoolMaxSize);

  setDefaultMaxPerRoute(Math.min(connectionPoolSize, connectionPoolMaxSize));
  log.debug("Connection pool size: {}", connectionPoolSize);

  this.connectionPoolIdleTime = checkNotNull(connectionPoolIdleTime);
  this.connectionPoolEvictingDelayTime = checkNotNull(connectionPoolEvictingDelayTime);
  setValidateAfterInactivity(connectionPoolValidateAfterInactivityTime.toMillisI());
  log.debug("Connection pool idle-time: {}, evicting delay: {}, validate after inactivity: {}",
      connectionPoolIdleTime, connectionPoolEvictingDelayTime, connectionPoolValidateAfterInactivityTime);
}
项目:spring-cloud-commons    文件:DefaultApacheHttpClientConnectionManagerFactoryTests.java   
private Lookup<ConnectionSocketFactory> getConnectionSocketFactoryLookup(
        HttpClientConnectionManager connectionManager) {
    DefaultHttpClientConnectionOperator connectionOperator = getField(
            connectionManager, "connectionOperator");
    return getField(connectionOperator, "socketFactoryRegistry");
}
项目:spring-cloud-netflix    文件:FeignHttpClientConfigurationTests.java   
private Lookup<ConnectionSocketFactory> getConnectionSocketFactoryLookup(HttpClientConnectionManager connectionManager) {
    DefaultHttpClientConnectionOperator connectionOperator = (DefaultHttpClientConnectionOperator)this.getField(connectionManager, "connectionOperator");
    return (Lookup)this.getField(connectionOperator, "socketFactoryRegistry");
}