@@ -57,6 +57,7 @@ public class AsyncHttpClientConfig {
57
57
protected int maxConnectionPerHost ;
58
58
protected int connectionTimeOutInMs ;
59
59
protected int idleConnectionInPoolTimeoutInMs ;
60
+ protected int idleConnectionTimeoutInMs ;
60
61
protected int requestTimeoutInMs ;
61
62
protected boolean redirectEnabled ;
62
63
protected int maxDefaultRedirects ;
@@ -89,6 +90,7 @@ private AsyncHttpClientConfig(int maxTotalConnections,
89
90
int maxConnectionPerHost ,
90
91
int connectionTimeOutInMs ,
91
92
int idleConnectionInPoolTimeoutInMs ,
93
+ int idleConnectionTimeoutInMs ,
92
94
int requestTimeoutInMs ,
93
95
boolean redirectEnabled ,
94
96
int maxDefaultRedirects ,
@@ -117,6 +119,7 @@ private AsyncHttpClientConfig(int maxTotalConnections,
117
119
this .maxConnectionPerHost = maxConnectionPerHost ;
118
120
this .connectionTimeOutInMs = connectionTimeOutInMs ;
119
121
this .idleConnectionInPoolTimeoutInMs = idleConnectionInPoolTimeoutInMs ;
122
+ this .idleConnectionTimeoutInMs = idleConnectionTimeoutInMs ;
120
123
this .requestTimeoutInMs = requestTimeoutInMs ;
121
124
this .redirectEnabled = redirectEnabled ;
122
125
this .maxDefaultRedirects = maxDefaultRedirects ;
@@ -188,10 +191,9 @@ public int getConnectionTimeoutInMs() {
188
191
* Return the maximum time in millisecond an {@link com.ning.http.client.AsyncHttpClient} can stay idle.
189
192
*
190
193
* @return the maximum time in millisecond an {@link com.ning.http.client.AsyncHttpClient} can stay idle.
191
- * @deprecated Please use {@link com.ning.http.client.AsyncHttpClientConfig#getIdleConnectionInPoolTimeoutInMs()}
192
194
*/
193
195
public int getIdleConnectionTimeoutInMs () {
194
- return idleConnectionInPoolTimeoutInMs ;
196
+ return idleConnectionTimeoutInMs ;
195
197
}
196
198
197
199
/**
@@ -451,6 +453,7 @@ public static class Builder {
451
453
private int defaultMaxConnectionPerHost = Integer .getInteger (ASYNC_CLIENT + "defaultMaxConnectionsPerHost" , -1 );
452
454
private int defaultConnectionTimeOutInMs = Integer .getInteger (ASYNC_CLIENT + "defaultConnectionTimeoutInMS" , 60 * 1000 );
453
455
private int defaultIdleConnectionInPoolTimeoutInMs = Integer .getInteger (ASYNC_CLIENT + "defaultIdleConnectionInPoolTimeoutInMS" , 60 * 1000 );
456
+ private int defaultIdleConnectionTimeoutInMs = Integer .getInteger (ASYNC_CLIENT + "defaultIdleConnectionTimeoutInMS" , 60 * 1000 );
454
457
private int defaultRequestTimeoutInMs = Integer .getInteger (ASYNC_CLIENT + "defaultRequestTimeoutInMS" , 60 * 1000 );
455
458
private boolean redirectEnabled = Boolean .getBoolean (ASYNC_CLIENT + "defaultRedirectsEnabled" );
456
459
private int maxDefaultRedirects = Integer .getInteger (ASYNC_CLIENT + "defaultMaxRedirects" , 5 );
@@ -531,10 +534,9 @@ public Builder setConnectionTimeoutInMs(int defaultConnectionTimeOutInMs) {
531
534
* @param defaultIdleConnectionTimeoutInMs
532
535
* the maximum time in millisecond an {@link com.ning.http.client.AsyncHttpClient} can stay idle.
533
536
* @return a {@link Builder}
534
- * @deprecated Please use {@link Builder#setIdleConnectionInPoolTimeoutInMs(int)}
535
537
*/
536
538
public Builder setIdleConnectionTimeoutInMs (int defaultIdleConnectionTimeoutInMs ) {
537
- this .defaultIdleConnectionInPoolTimeoutInMs = defaultIdleConnectionTimeoutInMs ;
539
+ this .defaultIdleConnectionTimeoutInMs = defaultIdleConnectionTimeoutInMs ;
538
540
return this ;
539
541
}
540
542
@@ -905,6 +907,7 @@ public Builder(AsyncHttpClientConfig prototype) {
905
907
connectionsPool = prototype .getConnectionsPool ();
906
908
defaultConnectionTimeOutInMs = prototype .getConnectionTimeoutInMs ();
907
909
defaultIdleConnectionInPoolTimeoutInMs = prototype .getIdleConnectionInPoolTimeoutInMs ();
910
+ defaultIdleConnectionTimeoutInMs = prototype .getIdleConnectionTimeoutInMs ();
908
911
defaultMaxConnectionPerHost = prototype .getMaxConnectionPerHost ();
909
912
maxDefaultRedirects = prototype .getMaxRedirects ();
910
913
defaultMaxTotalConnections = prototype .getMaxTotalConnections ();
@@ -955,6 +958,7 @@ public AsyncHttpClientConfig build() {
955
958
defaultMaxConnectionPerHost ,
956
959
defaultConnectionTimeOutInMs ,
957
960
defaultIdleConnectionInPoolTimeoutInMs ,
961
+ defaultIdleConnectionTimeoutInMs ,
958
962
defaultRequestTimeoutInMs ,
959
963
redirectEnabled ,
960
964
maxDefaultRedirects ,
0 commit comments