@Deprecated public class SimpleHttpConnectionManager extends Object implements HttpConnectionManager
Modifier and Type | Field and Description |
---|---|
protected HttpConnection |
httpConnection
Deprecated.
The http connection
|
Constructor and Description |
---|
SimpleHttpConnectionManager()
Deprecated.
The connection manager created with this constructor will always try to keep
the connection open (alive) between consecutive requests.
|
SimpleHttpConnectionManager(boolean alwaysClose)
Deprecated.
The connection manager created with this constructor will try to keep the
connection open (alive) between consecutive requests if the alwaysClose
parameter is set to false.
|
Modifier and Type | Method and Description |
---|---|
void |
closeIdleConnections(long idleTimeout)
Deprecated.
Closes connections that have been idle for at least the given amount of time.
|
HttpConnection |
getConnection(HostConfiguration hostConfiguration)
Deprecated.
Gets an HttpConnection for a given host configuration.
|
HttpConnection |
getConnection(HostConfiguration hostConfiguration,
long timeout)
Deprecated.
Use #getConnectionWithTimeout(HostConfiguration, long)
|
HttpConnection |
getConnectionWithTimeout(HostConfiguration hostConfiguration,
long timeout)
Deprecated.
This method always returns the same connection object.
|
HttpConnectionManagerParams |
getParams()
Deprecated.
Returns
parameters associated
with this connection manager. |
boolean |
isConnectionStaleCheckingEnabled()
|
void |
releaseConnection(HttpConnection conn)
Deprecated.
Releases the given HttpConnection for use by other requests.
|
void |
setConnectionStaleCheckingEnabled(boolean connectionStaleCheckingEnabled)
|
void |
setParams(HttpConnectionManagerParams params)
Deprecated.
Assigns
parameters for this
connection manager. |
void |
shutdown()
Deprecated.
since 3.1
|
protected HttpConnection httpConnection
public SimpleHttpConnectionManager(boolean alwaysClose)
alwaysClose
- if set true, the connection manager will always
close connections upon release.public SimpleHttpConnectionManager()
public HttpConnection getConnection(HostConfiguration hostConfiguration)
HttpConnectionManager
getConnection
in interface HttpConnectionManager
hostConfiguration
- 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)
HttpConnectionParams.setStaleCheckingEnabled(boolean)
,
HttpConnectionManager.getParams()
.connectionStaleCheckingEnabled
- true
if stale checking will be enabled
on HttpConectionsHttpConnection.setStaleCheckingEnabled(boolean)
public HttpConnection getConnectionWithTimeout(HostConfiguration hostConfiguration, long timeout)
getConnectionWithTimeout
in interface HttpConnectionManager
hostConfiguration
- The host configuration specifying the connection
details.timeout
- this parameter has no effect. The connection is always returned
immediately.HttpConnection.setHttpConnectionManager(HttpConnectionManager)
public HttpConnection getConnection(HostConfiguration hostConfiguration, long timeout)
HttpConnectionManager
getConnection
in interface HttpConnectionManager
hostConfiguration
- 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)
HttpConnectionManager
releaseConnection
in interface HttpConnectionManager
conn
- - The HttpConnection to make available.HttpConnectionManager.releaseConnection(org.apache.commons.httpclient.HttpConnection)
public HttpConnectionManagerParams getParams()
parameters
associated
with this connection manager.getParams
in interface HttpConnectionManager
HttpConnectionManagerParams
public void setParams(HttpConnectionManagerParams params)
parameters
for this
connection manager.setParams
in interface HttpConnectionManager
HttpConnectionManagerParams
public void closeIdleConnections(long idleTimeout)
HttpConnectionManager
closeIdleConnections
in interface HttpConnectionManager
idleTimeout
- the minimum idle time, in milliseconds, for connections to be closedpublic void shutdown()
Copyright © 2004–2017. All rights reserved.