org.apache.commons.httpclient

Class SimpleHttpConnectionManager

Implemented Interfaces:
HttpConnectionManager

public class SimpleHttpConnectionManager
extends Object
implements HttpConnectionManager

A connection manager that provides access to a single HttpConnection. This manager makes no attempt to provide exclusive access to the contained HttpConnection.

Authors:
Michael Becke
Eric Johnson
Mike Bowler
Oleg Kalnichevski
Laura Werner

Since:
2.0

Field Summary

protected HttpConnection
httpConnection
The http connection

Constructor Summary

SimpleHttpConnectionManager()

Method Summary

void
closeIdleConnections(long idleTimeout)
HttpConnection
getConnection(HostConfiguration hostConfiguration)
HttpConnection
getConnection(HostConfiguration hostConfiguration, long timeout)
Deprecated. Use #getConnectionWithTimeout(HostConfiguration, long)
HttpConnection
getConnectionWithTimeout(HostConfiguration hostConfiguration, long timeout)
HttpConnectionManagerParams
getParams()
Returns parameters associated with this connection manager.
boolean
isConnectionStaleCheckingEnabled()
Deprecated. Use HttpConnectionManagerParams.isStaleCheckingEnabled(),
void
releaseConnection(HttpConnection conn)
void
setConnectionStaleCheckingEnabled(boolean connectionStaleCheckingEnabled)
Deprecated. Use HttpConnectionManagerParams.setStaleCheckingEnabled(boolean),
void
setParams(HttpConnectionManagerParams params)
Assigns parameters for this connection manager.

Field Details

httpConnection

protected HttpConnection httpConnection
The http connection

Constructor Details

SimpleHttpConnectionManager

public SimpleHttpConnectionManager()

Method Details

closeIdleConnections

public void closeIdleConnections(long idleTimeout)
Specified by:
closeIdleConnections in interface HttpConnectionManager

Since:
3.0


getConnection

public HttpConnection getConnection(HostConfiguration hostConfiguration)
Specified by:
getConnection in interface HttpConnectionManager

See Also:
HttpConnectionManager.getConnection(HostConfiguration)


getConnection

public HttpConnection getConnection(HostConfiguration hostConfiguration,
                                    long timeout)

Deprecated. Use #getConnectionWithTimeout(HostConfiguration, long)

Specified by:
getConnection in interface HttpConnectionManager

See Also:
HttpConnectionManager.getConnection(HostConfiguration,long)


getConnectionWithTimeout

public HttpConnection getConnectionWithTimeout(HostConfiguration hostConfiguration,
                                               long timeout)
Specified by:
getConnectionWithTimeout in interface HttpConnectionManager

Since:
3.0

See Also:
HttpConnectionManager.getConnectionWithTimeout(HostConfiguration,long)


getParams

public HttpConnectionManagerParams getParams()
Returns parameters associated with this connection manager.
Specified by:
getParams in interface HttpConnectionManager

Since:
2.1

See Also:
HttpConnectionManagerParams


isConnectionStaleCheckingEnabled

public boolean isConnectionStaleCheckingEnabled()

Deprecated. Use HttpConnectionManagerParams.isStaleCheckingEnabled(),

Gets the staleCheckingEnabled value to be set on HttpConnections that are created. HttpConnectionManager.getParams().

Returns:
true if stale checking will be enabled on HttpConections

See Also:
HttpConnection.isStaleCheckingEnabled()


releaseConnection

public void releaseConnection(HttpConnection conn)
Specified by:
releaseConnection in interface HttpConnectionManager

See Also:
HttpConnectionManager.releaseConnection(HttpConnection)


setConnectionStaleCheckingEnabled

public void setConnectionStaleCheckingEnabled(boolean connectionStaleCheckingEnabled)

Deprecated. Use HttpConnectionManagerParams.setStaleCheckingEnabled(boolean),

Sets the staleCheckingEnabled value to be set on HttpConnections that are created. HttpConnectionManager.getParams().

Parameters:
connectionStaleCheckingEnabled - true if stale checking will be enabled on HttpConections

See Also:
HttpConnection.setStaleCheckingEnabled(boolean)


setParams

public void setParams(HttpConnectionManagerParams params)
Assigns parameters for this connection manager.
Specified by:
setParams in interface HttpConnectionManager

Since:
2.1

See Also:
HttpConnectionManagerParams


Copyright (c) 1999-2005 - Apache Software Foundation