51
51
*/
52
52
public class AsyncHttpClientConfig {
53
53
54
- private final static String ASYNC_CLIENT = AsyncHttpClientConfig .class .getName () + "." ;
55
-
56
- private final int maxTotalConnections ;
57
- private final int maxConnectionPerHost ;
58
- private final int connectionTimeOutInMs ;
59
- private final int idleConnectionInPoolTimeoutInMs ;
60
- private final int requestTimeoutInMs ;
61
- private final boolean redirectEnabled ;
62
- private final int maxDefaultRedirects ;
63
- private final boolean compressionEnabled ;
64
- private final String userAgent ;
65
- private final boolean allowPoolingConnection ;
66
- private final ScheduledExecutorService reaper ;
67
- private final ExecutorService applicationThreadPool ;
68
- private final ProxyServer proxyServer ;
69
- private final SSLContext sslContext ;
70
- private final SSLEngineFactory sslEngineFactory ;
71
- private final AsyncHttpProviderConfig <?, ?> providerConfig ;
72
- private final ConnectionsPool <?, ?> connectionsPool ;
73
- private final Realm realm ;
74
- private final List <RequestFilter > requestFilters ;
75
- private final List <ResponseFilter > responseFilters ;
76
- private final List <IOExceptionFilter > ioExceptionFilters ;
77
- private final int requestCompressionLevel ;
78
- private final int maxRequestRetry ;
79
- private final boolean allowSslConnectionPool ;
80
- private final boolean useRawUrl ;
81
- private final boolean removeQueryParamOnRedirect ;
82
- private final HostnameVerifier hostnameVerifier ;
83
- private final int ioThreadMultiplier ;
54
+ protected final static String ASYNC_CLIENT = AsyncHttpClientConfig .class .getName () + "." ;
55
+
56
+ protected int maxTotalConnections ;
57
+ protected int maxConnectionPerHost ;
58
+ protected int connectionTimeOutInMs ;
59
+ protected int idleConnectionInPoolTimeoutInMs ;
60
+ protected int requestTimeoutInMs ;
61
+ protected boolean redirectEnabled ;
62
+ protected int maxDefaultRedirects ;
63
+ protected boolean compressionEnabled ;
64
+ protected String userAgent ;
65
+ protected boolean allowPoolingConnection ;
66
+ protected ScheduledExecutorService reaper ;
67
+ protected ExecutorService applicationThreadPool ;
68
+ protected ProxyServer proxyServer ;
69
+ protected SSLContext sslContext ;
70
+ protected SSLEngineFactory sslEngineFactory ;
71
+ protected AsyncHttpProviderConfig <?, ?> providerConfig ;
72
+ protected ConnectionsPool <?, ?> connectionsPool ;
73
+ protected Realm realm ;
74
+ protected List <RequestFilter > requestFilters ;
75
+ protected List <ResponseFilter > responseFilters ;
76
+ protected List <IOExceptionFilter > ioExceptionFilters ;
77
+ protected int requestCompressionLevel ;
78
+ protected int maxRequestRetry ;
79
+ protected boolean allowSslConnectionPool ;
80
+ protected boolean useRawUrl ;
81
+ protected boolean removeQueryParamOnRedirect ;
82
+ protected HostnameVerifier hostnameVerifier ;
83
+ protected int ioThreadMultiplier ;
84
+
85
+ protected AsyncHttpClientConfig (){
86
+ }
84
87
85
88
private AsyncHttpClientConfig (int maxTotalConnections ,
86
89
int maxConnectionPerHost ,
@@ -902,7 +905,6 @@ public Builder(AsyncHttpClientConfig prototype) {
902
905
connectionsPool = prototype .getConnectionsPool ();
903
906
defaultConnectionTimeOutInMs = prototype .getConnectionTimeoutInMs ();
904
907
defaultIdleConnectionInPoolTimeoutInMs = prototype .getIdleConnectionInPoolTimeoutInMs ();
905
- allowPoolingConnection = prototype .getKeepAlive ();
906
908
defaultMaxConnectionPerHost = prototype .getMaxConnectionPerHost ();
907
909
maxDefaultRedirects = prototype .getMaxRedirects ();
908
910
defaultMaxTotalConnections = prototype .getMaxTotalConnections ();
@@ -912,14 +914,26 @@ public Builder(AsyncHttpClientConfig prototype) {
912
914
sslContext = prototype .getSSLContext ();
913
915
sslEngineFactory = prototype .getSSLEngineFactory ();
914
916
userAgent = prototype .getUserAgent ();
917
+ redirectEnabled = prototype .isRedirectEnabled ();
918
+ compressionEnabled = prototype .isCompressionEnabled ();
919
+ reaper = prototype .reaper ();
920
+ applicationThreadPool = prototype .executorService ();
915
921
916
922
requestFilters .clear ();
917
923
responseFilters .clear ();
924
+ ioExceptionFilters .clear ();
918
925
919
926
requestFilters .addAll (prototype .getRequestFilters ());
920
927
responseFilters .addAll (prototype .getResponseFilters ());
928
+ ioExceptionFilters .addAll (prototype .getIOExceptionFilters ());
929
+
930
+ requestCompressionLevel = prototype .getRequestCompressionLevel ();
921
931
useRawUrl = prototype .isUseRawUrl ();
922
932
ioThreadMultiplier = prototype .getIoThreadMultiplier ();
933
+ maxRequestRetry = prototype .getMaxRequestRetry ();
934
+ allowSslConnectionPool = prototype .getAllowPoolingConnection ();
935
+ removeQueryParamOnRedirect = prototype .isRemoveQueryParamOnRedirect ();
936
+ hostnameVerifier = prototype .getHostnameVerifier ();
923
937
}
924
938
925
939
/**
0 commit comments