final ConnectionPool connectionPool,//
final FilterChainBuilder secureBuilder,//
final FilterChainBuilder nonSecureBuilder) {
this.provider = provider;
final AsyncHttpClientConfig config = provider.getClientConfig();
if (connectionPool != null) {
this.connectionPool = connectionPool;
canDestroyPool = false;
} else {
this.connectionPool = new ConnectionPool(config.getMaxConnectionsPerHost(),//
config.getMaxConnections(),//
null,//
config.getConnectTimeout(),//
config.getPooledConnectionIdleTimeout(),//
2000);
canDestroyPool = true;
}
this.secureBuilder = secureBuilder;
this.nonSecureBuilder = nonSecureBuilder;
AsyncHttpProviderConfig<?, ?> providerConfig = config.getAsyncHttpProviderConfig();
asyncConnect = providerConfig instanceof GrizzlyAsyncHttpProviderConfig ? GrizzlyAsyncHttpProviderConfig.class.cast(providerConfig)
.isAsyncConnectMode() : false;
}