flex.messaging.services.http
Class HTTPConnectionManagerSettings

java.lang.Object
  extended by flex.messaging.services.http.HTTPConnectionManagerSettings

public class HTTPConnectionManagerSettings
extends Object

Establishes the settings used to construct an Apache Commons HTTPClient HttpConnectionManager for the Proxy Service.


Field Summary
static int DEFAULT_MAX_CONNECTIONS_HOST
          The default maximum number of connections allowed per host.
static int DEFAULT_MAX_TOTAL_CONNECTIONS
          The default maximum number of connections allowed overall.
 
Constructor Summary
HTTPConnectionManagerSettings()
          Creates a default HTTPConnectionManagerSettings instance.
 
Method Summary
 int getConnectionTimeout()
          Returns the number of milliseconds to wait before a connection will timeout.
 int getDefaultMaxConnectionsPerHost()
          Returns the default maximum number of connections allowed per host.
 int getLinger()
          Returns linger-on-close timeout in seconds.
 List getMaxConnectionsPerHost()
          Returns a collection of HostConfigurationSettings which specify connection options on a host-by-host basis.
 int getMaxTotalConnections()
          Returns the maximum number of connections allowed.
 int getReceiveBufferSize()
          Returns The size of the underlying receive buffers.
 int getSendBufferSize()
          Return the size of the underlying send buffers.
 int getSocketTimeout()
          Return the default socket timeout in milliseconds for waiting for data.
 boolean isStaleCheckingEnabled()
          Returns whether a check for stale connections is to be performed.
 boolean isTcpNoDelay()
          Return whether Nagle's algorithm should be used for this connection.
 void setConnectionTimeout(int value)
          Sets the number of milliseconds to wait before a connection will timeout.
 void setDefaultMaxConnectionsPerHost(int value)
          Sets the default maximum number of connections allowed per host.
 void setLinger(int linger)
          Sets the linger-on-close timeout (in seconds).
 void setMaxConnectionsPerHost(List value)
          Sets the list of HostConfigurationSettings specifying connection options on a host-by-host basis.
 void setMaxTotalConnections(int value)
          Sets the maximum number of connections allowed.
 void setReceiveBufferSize(int value)
          Sets a suggestion for kernel from the application about the size of buffers to use for the data to be received over the socket.
 void setSendBufferSize(int sendBufferSize)
          Sets a suggestion for kernel from the application about the size of buffers to use for the data to be sent over the socket.
 void setSocketTimeout(int value)
          Sets the socket timeout in milliseconds for waiting for data.
 void setStaleCheckingEnabled(boolean value)
          Sets whether a check should be performed for stale connections.
 void setTcpNoDelay(boolean value)
          Sets whether Nagle's algorithm should be used for this connection.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_MAX_CONNECTIONS_HOST

public static final int DEFAULT_MAX_CONNECTIONS_HOST
The default maximum number of connections allowed per host.

See Also:
Constant Field Values

DEFAULT_MAX_TOTAL_CONNECTIONS

public static final int DEFAULT_MAX_TOTAL_CONNECTIONS
The default maximum number of connections allowed overall.

See Also:
Constant Field Values
Constructor Detail

HTTPConnectionManagerSettings

public HTTPConnectionManagerSettings()
Creates a default HTTPConnectionManagerSettings instance.

Method Detail

getConnectionTimeout

public int getConnectionTimeout()
Returns the number of milliseconds to wait before a connection will timeout.

Returns:
The number of milliseconds to wait until a connection is established. The default value is 0 which means a timeout is not used.

setConnectionTimeout

public void setConnectionTimeout(int value)
Sets the number of milliseconds to wait before a connection will timeout.

Parameters:
value - - timeout in milliseconds

getDefaultMaxConnectionsPerHost

public int getDefaultMaxConnectionsPerHost()
Returns the default maximum number of connections allowed per host.

Returns:
The default maximum number of connections allowed per host. The default is 2 as per RFC 2616 section 8.1.4.

setDefaultMaxConnectionsPerHost

public void setDefaultMaxConnectionsPerHost(int value)
Sets the default maximum number of connections allowed per host.

Parameters:
value - - the maximum number of connections

getLinger

public int getLinger()
Returns linger-on-close timeout in seconds.

Returns:
int - A value of 0 implies that the option is disabled. A value of -1 implies that the JRE default is used.

setLinger

public void setLinger(int linger)
Sets the linger-on-close timeout (in seconds).

Parameters:
linger - An int. Use 0 to disable. Use -1 to rely on the JRE default.

getMaxConnectionsPerHost

public List getMaxConnectionsPerHost()
Returns a collection of HostConfigurationSettings which specify connection options on a host-by-host basis.

Returns:
A List of HostConfigurationSettings.
See Also:
HostConfigurationSettings

setMaxConnectionsPerHost

public void setMaxConnectionsPerHost(List value)
Sets the list of HostConfigurationSettings specifying connection options on a host-by-host basis.

Parameters:
value - The list of HostConfigurationSettings.
See Also:
HostConfigurationSettings

getMaxTotalConnections

public int getMaxTotalConnections()
Returns the maximum number of connections allowed.

Returns:
The maximum number of connections allowed.

setMaxTotalConnections

public void setMaxTotalConnections(int value)
Sets the maximum number of connections allowed.

Parameters:
value - - the maximum number of connections

getReceiveBufferSize

public int getReceiveBufferSize()
Returns The size of the underlying receive buffers.

Returns:
The hint given to the kernel about the size of the underlying buffers used by the platform for incoming network I/O.

setReceiveBufferSize

public void setReceiveBufferSize(int value)
Sets a suggestion for kernel from the application about the size of buffers to use for the data to be received over the socket.

Parameters:
value - - the suggested receive buffer size

getSendBufferSize

public int getSendBufferSize()
Return the size of the underlying send buffers.

Returns:
The hint given to the kernel about the size of the underlying buffers used by the platform for outgoing network I/O.

setSendBufferSize

public void setSendBufferSize(int sendBufferSize)
Sets a suggestion for kernel from the application about the size of buffers to use for the data to be sent over the socket.

Parameters:
sendBufferSize - the suggested send buffer size

getSocketTimeout

public int getSocketTimeout()
Return the default socket timeout in milliseconds for waiting for data.

Returns:
The default socket timeout in milliseconds for waiting for data. The default is 0 which is interpreted as an infinite timeout.

setSocketTimeout

public void setSocketTimeout(int value)
Sets the socket timeout in milliseconds for waiting for data.

Parameters:
value - - the timeout in milliseconds

isStaleCheckingEnabled

public boolean isStaleCheckingEnabled()
Returns whether a check for stale connections is to be performed.

Returns:
Whether a check for stale connections is to be performed. The default is true.

setStaleCheckingEnabled

public void setStaleCheckingEnabled(boolean value)
Sets whether a check should be performed for stale connections. Disabling the check may result in a slight performance improvement at the risk of getting an I/O error when executing a request over a connection that has been closed at the server side.

Parameters:
value - - whether stale connection checking should be performed

isTcpNoDelay

public boolean isTcpNoDelay()
Return whether Nagle's algorithm should be used for this connection.

Returns:
Determines whether Nagle's algorithm is to be used with this connection. The default is true and Nagle's algorithm is NOT to be used (i.e. TCP_NODELAY is enabled).

setTcpNoDelay

public void setTcpNoDelay(boolean value)
Sets whether Nagle's algorithm should be used for this connection. If set to true, Nagle's algorithm is to NOT be used (i.e. TCP_NODELAY is enabled).

Parameters:
value - - whether Nagle's algorithm should be used


Copyright © 2008 Adobe Systems Inc. All Rights Reserved.

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/blazeds/1/javadoc/flex/messaging/services/http/HTTPConnectionManagerSettings.html