File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
httpclient5/src/main/java/org/apache/hc/client5/http/impl Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change 7979import org .apache .hc .core5 .pool .PoolEntry ;
8080import org .apache .hc .core5 .pool .PoolReusePolicy ;
8181import org .apache .hc .core5 .pool .PoolStats ;
82+ import org .apache .hc .core5 .pool .RouteSegmentedConnPool ;
8283import org .apache .hc .core5 .pool .StrictConnPool ;
8384import org .apache .hc .core5 .util .Args ;
8485import org .apache .hc .core5 .util .Deadline ;
@@ -272,6 +273,14 @@ public void closeExpired() {
272273
273274 };
274275 break ;
276+ case OFFLOCK :
277+ this .pool = new RouteSegmentedConnPool <>(
278+ DEFAULT_MAX_CONNECTIONS_PER_ROUTE ,
279+ DEFAULT_MAX_TOTAL_CONNECTIONS ,
280+ timeToLive ,
281+ poolReusePolicy ,
282+ new DefaultDisposalCallback <>());
283+ break ;
275284 default :
276285 throw new IllegalArgumentException ("Unexpected PoolConcurrencyPolicy value: " + poolConcurrencyPolicy );
277286 }
Original file line number Diff line number Diff line change 8686import org .apache .hc .core5 .pool .PoolEntry ;
8787import org .apache .hc .core5 .pool .PoolReusePolicy ;
8888import org .apache .hc .core5 .pool .PoolStats ;
89+ import org .apache .hc .core5 .pool .RouteSegmentedConnPool ;
8990import org .apache .hc .core5 .pool .StrictConnPool ;
9091import org .apache .hc .core5 .reactor .Command ;
9192import org .apache .hc .core5 .reactor .ConnectionInitiator ;
@@ -208,6 +209,14 @@ public void closeExpired() {
208209
209210 };
210211 break ;
212+ case OFFLOCK :
213+ managedConnPool = new RouteSegmentedConnPool <>(
214+ DEFAULT_MAX_CONNECTIONS_PER_ROUTE ,
215+ DEFAULT_MAX_TOTAL_CONNECTIONS ,
216+ timeToLive ,
217+ poolReusePolicy ,
218+ new DefaultDisposalCallback <>());
219+ break ;
211220 default :
212221 throw new IllegalArgumentException ("Unexpected PoolConcurrencyPolicy value: " + poolConcurrencyPolicy );
213222 }
You can’t perform that action at this time.
0 commit comments