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 String CONNECTION_MANAGER
           
static String CONNECTION_TIMEOUT
           
static int DEFAULT_MAX_CONNECTIONS_HOST
          The default maximum number of connections allowed per host
static String DEFAULT_MAX_CONNECTIONS_PER_HOST
           
static int DEFAULT_MAX_TOTAL_CONNECTIONS
          The default maximum number of connections allowed overall
static String LINGER
           
static String MAX_PER_HOST
           
static String MAX_TOTAL_CONNECTIONS
           
static String RECEIVE_BUFFER_SIZE
           
static String SEND_BUFFER_SIZE
           
static String SOCKET_TIMEOUT
           
static String STALE_CHECKING_ENABLED
           
static String TCP_NO_DELAY
           
 
Constructor Summary
HTTPConnectionManagerSettings()
          Creates a default HTTPConnectionManagerSettings instance.
 
Method Summary
 int getConnectionTimeout()
           
 int getDefaultMaxConnectionsPerHost()
           
 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()
           
 int getReceiveBufferSize()
           
 int getSendBufferSize()
           
 int getSocketTimeout()
           
 boolean isStaleCheckingEnabled()
           
 boolean isTcpNoDelay()
           
 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

CONNECTION_MANAGER

public static final String CONNECTION_MANAGER
See Also:
Constant Field Values

CONNECTION_TIMEOUT

public static final String CONNECTION_TIMEOUT
See Also:
Constant Field Values

DEFAULT_MAX_CONNECTIONS_PER_HOST

public static final String DEFAULT_MAX_CONNECTIONS_PER_HOST
See Also:
Constant Field Values

LINGER

public static final String LINGER
See Also:
Constant Field Values

MAX_PER_HOST

public static final String MAX_PER_HOST
See Also:
Constant Field Values

MAX_TOTAL_CONNECTIONS

public static final String MAX_TOTAL_CONNECTIONS
See Also:
Constant Field Values

RECEIVE_BUFFER_SIZE

public static final String RECEIVE_BUFFER_SIZE
See Also:
Constant Field Values

SEND_BUFFER_SIZE

public static final String SEND_BUFFER_SIZE
See Also:
Constant Field Values

SOCKET_TIMEOUT

public static final String SOCKET_TIMEOUT
See Also:
Constant Field Values

STALE_CHECKING_ENABLED

public static final String STALE_CHECKING_ENABLED
See Also:
Constant Field Values

TCP_NO_DELAY

public static final String TCP_NO_DELAY
See Also:
Constant Field Values

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 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. 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.

See Also:
HostConfigurationSettings

getMaxTotalConnections

public int getMaxTotalConnections()
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 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()
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:
value - - the suggested send buffer size

getSocketTimeout

public int getSocketTimeout()
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. 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()
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 © 2007 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/livecycle/es/sdkHelp/programmer/lcdsjavadoc/flex/messaging/services/http/HTTPConnectionManagerSettings.html