Package org.dspace.service.impl
Class HttpConnectionPoolService
- java.lang.Object
-
- org.dspace.service.impl.HttpConnectionPoolService
-
@Named @Singleton public class HttpConnectionPoolService extends Object
Factory for HTTP clients sharing a pool of connections.You may create multiple pools. Each is identified by a configuration "prefix" (passed to the constructor) which is used to create names of properties which will configure the pool. The properties are:
- PREFIX.client.keepAlive
- Default keep-alive time for open connections, in milliseconds
- PREFIX.client.maxTotalConnections
- maximum open connections
- PREFIX.client.maxPerRoute
- maximum open connections per service instance
- PREFIX.client.timeToLive
- maximum lifetime of a pooled connection, in seconds
- Author:
- Mark H. Wood
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classHttpConnectionPoolService.IdleConnectionMonitorThreadClean up stale connections.classHttpConnectionPoolService.KeepAliveStrategyA connection keep-alive strategy that obeys the Keep-Alive header and applies a default if none is given.
-
Constructor Summary
Constructors Constructor Description HttpConnectionPoolService(String configPrefix)Construct a pool for a given set of configuration properties.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.http.impl.client.CloseableHttpClientgetClient()Create an HTTP client which uses a pooled connection.protected voidinit()
-
-
-
Constructor Detail
-
HttpConnectionPoolService
public HttpConnectionPoolService(String configPrefix)
Construct a pool for a given set of configuration properties.- Parameters:
configPrefix- Configuration property names will begin with this.
-
-