@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); }
private Lookup<ConnectionSocketFactory> getConnectionSocketFactoryLookup( HttpClientConnectionManager connectionManager) { DefaultHttpClientConnectionOperator connectionOperator = getField( connectionManager, "connectionOperator"); return getField(connectionOperator, "socketFactoryRegistry"); }
private Lookup<ConnectionSocketFactory> getConnectionSocketFactoryLookup(HttpClientConnectionManager connectionManager) { DefaultHttpClientConnectionOperator connectionOperator = (DefaultHttpClientConnectionOperator)this.getField(connectionManager, "connectionOperator"); return (Lookup)this.getField(connectionOperator, "socketFactoryRegistry"); }