public class SimpleHttpConnectionManager extends Object implements HttpConnectionManager
| 限定符和类型 | 字段和说明 |
|---|---|
protected HttpConnection |
httpConnection
The http connection
|
| 构造器和说明 |
|---|
SimpleHttpConnectionManager() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
closeIdleConnections(long idleTimeout)
Closes connections that have been idle for at least the given amount of time.
|
HttpConnection |
getConnection(HostConfiguration hostConfiguration)
Gets an HttpConnection for a given host configuration.
|
HttpConnection |
getConnection(HostConfiguration hostConfiguration,
long timeout)
已过时。
Use #getConnectionWithTimeout(HostConfiguration, long)
|
HttpConnection |
getConnectionWithTimeout(HostConfiguration hostConfiguration,
long timeout)
Gets an HttpConnection for a given host configuration.
|
HttpConnectionManagerParams |
getParams()
Returns
parameters associated
with this connection manager. |
boolean |
isConnectionStaleCheckingEnabled()
|
void |
releaseConnection(HttpConnection conn)
Releases the given HttpConnection for use by other requests.
|
void |
setConnectionStaleCheckingEnabled(boolean connectionStaleCheckingEnabled)
|
void |
setParams(HttpConnectionManagerParams params)
Assigns
parameters for this
connection manager. |
protected HttpConnection httpConnection
public HttpConnection getConnection(HostConfiguration hostConfiguration)
HttpConnectionManagergetConnection 在接口中 HttpConnectionManagerhostConfiguration - the host configuration to use to configure the
connectionHttpConnectionManager.getConnection(HostConfiguration)public boolean isConnectionStaleCheckingEnabled()
true if stale checking will be enabled on HttpConectionsHttpConnection.isStaleCheckingEnabled()public void setConnectionStaleCheckingEnabled(boolean connectionStaleCheckingEnabled)
connectionStaleCheckingEnabled - true if stale checking will be enabled
on HttpConectionsHttpConnection.setStaleCheckingEnabled(boolean)public HttpConnection getConnectionWithTimeout(HostConfiguration hostConfiguration, long timeout)
HttpConnectionManagergetConnectionWithTimeout 在接口中 HttpConnectionManagerhostConfiguration - the host configuration to use to configure the
connectiontimeout - - the time (in milliseconds) to wait for a connection to
become available, 0 to specify an infinite timeoutHttpConnectionManager.getConnectionWithTimeout(HostConfiguration, long)public HttpConnection getConnection(HostConfiguration hostConfiguration, long timeout)
HttpConnectionManagergetConnection 在接口中 HttpConnectionManagerhostConfiguration - the host configuration to use to configure the
connectiontimeout - - the time (in milliseconds) to wait for a connection to
become available, 0 to specify an infinite timeoutHttpConnectionManager.getConnection(HostConfiguration, long)public void releaseConnection(HttpConnection conn)
HttpConnectionManagerreleaseConnection 在接口中 HttpConnectionManagerconn - - The HttpConnection to make available.HttpConnectionManager.releaseConnection(com.ptteng.course.util.aliPayUtil.apacheCommonUtil.httpclient.HttpConnection)public HttpConnectionManagerParams getParams()
parameters associated
with this connection manager.getParams 在接口中 HttpConnectionManagerHttpConnectionManagerParamspublic void setParams(HttpConnectionManagerParams params)
parameters for this
connection manager.setParams 在接口中 HttpConnectionManagerHttpConnectionManagerParamspublic void closeIdleConnections(long idleTimeout)
HttpConnectionManagercloseIdleConnections 在接口中 HttpConnectionManageridleTimeout - the minimum idle time, in milliseconds, for connections to be closedCopyright © 2017. All rights reserved.