Package org.dspace.service.impl
Class HttpConnectionPoolService
java.lang.Object
org.dspace.service.impl.HttpConnectionPoolService
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 <mwood@iupui.edu>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassClean up stale connections.classA connection keep-alive strategy that obeys the Keep-Alive header and applies a default if none is given. -
Constructor Summary
ConstructorsConstructorDescriptionHttpConnectionPoolService(String configPrefix) Construct a pool for a given set of configuration properties. -
Method Summary
-
Constructor Details
-
HttpConnectionPoolService
Construct a pool for a given set of configuration properties.- Parameters:
configPrefix- Configuration property names will begin with this.
-
-
Method Details
-
init
@PostConstruct protected void init() -
getClient
public org.apache.http.impl.client.CloseableHttpClient getClient()Create an HTTP client which uses a pooled connection.- Returns:
- the client.
-