org.apache.commons.httpclient

Class SimpleHttpConnectionManager

Implemented Interfaces:
HttpConnectionManager

public class SimpleHttpConnectionManager
extends java.lang.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(), HttpConnectionManager.getParams().
void
releaseConnection(HttpConnection conn)
void
setConnectionStaleCheckingEnabled(boolean connectionStaleCheckingEnabled)
Deprecated. Use HttpConnectionManagerParams.setStaleCheckingEnabled(boolean), HttpConnectionManager.getParams().
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

getConnection

public HttpConnection getConnection(HostConfiguration hostConfiguration,
                                    long timeout)

Deprecated. Use #getConnectionWithTimeout(HostConfiguration, long)

Specified by:
getConnection in interface HttpConnectionManager

getConnectionWithTimeout

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

getParams

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

isConnectionStaleCheckingEnabled

public boolean isConnectionStaleCheckingEnabled()

Deprecated. Use HttpConnectionManagerParams.isStaleCheckingEnabled(), HttpConnectionManager.getParams().

Gets the staleCheckingEnabled value to be set on HttpConnections that are created.
Returns:
true if stale checking will be enabled on HttpConections

releaseConnection

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

setConnectionStaleCheckingEnabled

public void setConnectionStaleCheckingEnabled(boolean connectionStaleCheckingEnabled)

Deprecated. Use HttpConnectionManagerParams.setStaleCheckingEnabled(boolean), HttpConnectionManager.getParams().

Sets the staleCheckingEnabled value to be set on HttpConnections that are created.
Parameters:
connectionStaleCheckingEnabled - true if stale checking will be enabled on HttpConections

setParams

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

Copyright (c) 1999-2005 - Apache Software Foundation