Package com.boomi.common.rest.pool
Class RestPoolingConnectionManager
- java.lang.Object
-
- org.apache.http.impl.conn.PoolingHttpClientConnectionManager
-
- com.boomi.common.rest.pool.RestPoolingConnectionManager
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,HttpClientConnectionManager
,ConnPoolControl<HttpRoute>
public class RestPoolingConnectionManager extends PoolingHttpClientConnectionManager
Tracks ifPoolingHttpClientConnectionManager
instance is in consumed and/or idle state.
-
-
Constructor Summary
Constructors Constructor Description RestPoolingConnectionManager(Registry<ConnectionSocketFactory> socketFactoryRegistry, int maxTotal)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isConsumed()
If a connection request has been created, then the Pooling manager is considered consumed.boolean
isIdle()
ConnectionRequest
requestConnection(HttpRoute route, Object state)
Sets the consumed flag to true when the Rest endpoint at givenHttpRoute
leases/consumes the pooled connection.-
Methods inherited from class org.apache.http.impl.conn.PoolingHttpClientConnectionManager
close, closeExpiredConnections, closeIdleConnections, connect, enumAvailable, enumLeased, finalize, getConnectionConfig, getDefaultConnectionConfig, getDefaultMaxPerRoute, getDefaultSocketConfig, getMaxPerRoute, getMaxTotal, getRoutes, getSocketConfig, getStats, getTotalStats, getValidateAfterInactivity, leaseConnection, releaseConnection, routeComplete, setConnectionConfig, setDefaultConnectionConfig, setDefaultMaxPerRoute, setDefaultSocketConfig, setMaxPerRoute, setMaxTotal, setSocketConfig, setValidateAfterInactivity, shutdown, upgrade
-
-
-
-
Constructor Detail
-
RestPoolingConnectionManager
public RestPoolingConnectionManager(Registry<ConnectionSocketFactory> socketFactoryRegistry, int maxTotal)
-
-
Method Detail
-
isConsumed
public boolean isConsumed()
If a connection request has been created, then the Pooling manager is considered consumed.- Returns:
- true if RestPoolingConnectionManager has been consumed, false otherwise.
-
isIdle
public boolean isIdle()
- Returns:
- true if pooling manager is in [leased:0, pending:0, available:0] state, false otherwise.
-
requestConnection
public ConnectionRequest requestConnection(HttpRoute route, Object state)
Sets the consumed flag to true when the Rest endpoint at givenHttpRoute
leases/consumes the pooled connection.- Specified by:
requestConnection
in interfaceHttpClientConnectionManager
- Overrides:
requestConnection
in classPoolingHttpClientConnectionManager
- Returns:
- connection request instance for given endpoint.
-
-