ice.net
Class ConnectionManagerSettings

java.lang.Object
  extended byice.net.ConnectionManagerSettings
All Implemented Interfaces:
Serializable, Settings

public class ConnectionManagerSettings
extends Object
implements Serializable, Settings

The ConnectionManagerSettings class specifies settings for a ConnectionManager.

Since:
1.5
Version:
1.5
Author:
Jack van Ooststroom
See Also:
Serialized Form

Constructor Summary
ConnectionManagerSettings()
          Constructs a ConnectionManagerSettings object.
 
Method Summary
static boolean areDefaultPersistentConnectionsEnabled()
          Returns the current boolean value of the ice.net.persistentConnectionsEnabled property.
 boolean arePersistentConnectionsEnabled()
          Returns whether or not the ConnectionManager to be created using this ConnectionManagerSettings uses PersistentConnections.
 boolean equals(Object object)
           
static int getDefaultMaxPersistentConnections()
          Returns the current int value of the ice.net.maxPersistentConnections property.
static int getDefaultPersistentConnectionTimeout()
          Returns the current int value of the ice.net.persistentConnectionTimeout property.
static int getDefaultReadBufferSize()
          Returns the current int value of the ice.net.readBufferSize property.
static int getDefaultSoTimeout()
          Returns the current int value of the ice.net.soTimeout property.
 int getMaxPersistentConnections()
          Returns the max PersistentConnections used by the ConnectionManager to be created using this ConnectionManagerSettings.
 int getPersistentConnectionTimeout()
          Returns the PersistentConnection timeout in seconds used by the ConnectionManager to be created using this ConnectionManagerSettings.
 int getReadBufferSize()
          Returns the read buffer size in bytes used by the ConnectionManager to be created using this ConnectionManagerSettings.
 int getSoTimeout()
          Returns the SO_TIMEOUT in milliseconds used by the ConnectionManager to be created using this ConnectionManagerSettings.
static boolean isDefaultNagleEnabled()
          Returns the current boolean value of the ice.net.nagleEnabled property.
 boolean isNagleEnabled()
          Returns whether or not the ConnectionManager to be created using this ConnectionManagerSettings uses Nagle's algorithm.
 void resetToDefault()
          Resets the settings of current instance to the default settings.
static void setDefaultMaxPersistentConnections(int maxPersistentConnections)
          Set the default max number of simultaneous PersistentConnections allowed to the specified maxPersistentConnections (recommendation is 4).
static void setDefaultNagleEnabled(boolean nagleEnabled)
           
static void setDefaultPersistentConnectionsEnabled(boolean persistentConnectionsEnabled)
           
static void setDefaultPersistentConnectionTimeout(int persistentConnectionTimeout)
           
static void setDefaultReadBufferSize(int readBufferSize)
           
static void setDefaultSoTimeout(int soTimeout)
           
 void setMaxPersistentConnections(int maxPersistentConnections)
          Set the max number of simultaneous persistent connections allowed (recommendation is 4).
 void setNagleEnabled(boolean nagleEnabled)
           
 void setPersistentConnectionsEnabled(boolean persistentConnectionsEnabled)
           
 void setPersistentConnectionTimeout(int persistentConnectionTimeout)
           
 void setReadBufferSize(int readBufferSize)
           
 void setSoTimeout(int soTimeout)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConnectionManagerSettings

public ConnectionManagerSettings()

Constructs a ConnectionManagerSettings object.

Method Detail

areDefaultPersistentConnectionsEnabled

public static boolean areDefaultPersistentConnectionsEnabled()

Returns the current boolean value of the ice.net.persistentConnectionsEnabled property.

Returns:
the boolean value of the ice.net.persistentConnectionsEnabled property.
See Also:
setDefaultPersistentConnectionsEnabled(boolean)

arePersistentConnectionsEnabled

public boolean arePersistentConnectionsEnabled()

Returns whether or not the ConnectionManager to be created using this ConnectionManagerSettings uses PersistentConnections.

Returns:
true if the ConnectionManager to be created uses persistent connections, false if not.
See Also:
setPersistentConnectionsEnabled(boolean), PersistentConnection

equals

public boolean equals(Object object)

getDefaultMaxPersistentConnections

public static int getDefaultMaxPersistentConnections()

Returns the current int value of the ice.net.maxPersistentConnections property.

Returns:
the int value of the ice.net.maxPersistentConnections property.
See Also:
setDefaultMaxPersistentConnections(int)

getDefaultPersistentConnectionTimeout

public static int getDefaultPersistentConnectionTimeout()

Returns the current int value of the ice.net.persistentConnectionTimeout property.

Returns:
the int value of the ice.net.persistentConnectionTimeout property.
See Also:
setDefaultPersistentConnectionTimeout(int)

getDefaultReadBufferSize

public static int getDefaultReadBufferSize()

Returns the current int value of the ice.net.readBufferSize property.

Returns:
the int value of the ice.net.readBufferSize property.
See Also:
setDefaultReadBufferSize(int)

getDefaultSoTimeout

public static int getDefaultSoTimeout()

Returns the current int value of the ice.net.soTimeout property.

Returns:
the int value of the ice.net.soTimeout property.
See Also:
setDefaultSoTimeout(int)

getMaxPersistentConnections

public int getMaxPersistentConnections()

Returns the max PersistentConnections used by the ConnectionManager to be created using this ConnectionManagerSettings.

Returns:
the max persistent connections.
See Also:
setMaxPersistentConnections(int), PersistentConnection

getPersistentConnectionTimeout

public int getPersistentConnectionTimeout()

Returns the PersistentConnection timeout in seconds used by the ConnectionManager to be created using this ConnectionManagerSettings.

Returns:
the persistent connection timeout in seconds.
See Also:
setPersistentConnectionTimeout(int), PersistentConnection

getReadBufferSize

public int getReadBufferSize()

Returns the read buffer size in bytes used by the ConnectionManager to be created using this ConnectionManagerSettings.

The actual read buffer size is used by the Connections created by the ConnectionManager.

Returns:
the read buffer size in bytes.
See Also:
setReadBufferSize(int), Connection

getSoTimeout

public int getSoTimeout()

Returns the SO_TIMEOUT in milliseconds used by the ConnectionManager to be created using this ConnectionManagerSettings.

The actual SO_TIMEOUT is used by the Sockets encapsulated in the Connections created by the ConenctionManager.

Returns:
the read buffer size in bytes.
See Also:
setReadBufferSize(int), Socket.setSoTimeout(int), Connection

isDefaultNagleEnabled

public static boolean isDefaultNagleEnabled()

Returns the current boolean value of the ice.net.nagleEnabled property.

Returns:
the boolean value of the ice.net.nagleEnabled property.
See Also:
setDefaultNagleEnabled(boolean)

isNagleEnabled

public boolean isNagleEnabled()

Returns whether or not the ConnectionManager to be created using this ConnectionManagerSettings uses Nagle's algorithm.

The actual Nagle algorithm is used by the Sockets encapsulated in the Connections created by the ConnectionManager.

Returns:
true if the ConnectionManager to be created uses the Nagle's algorithm, false if not.
See Also:
setNagleEnabled(boolean), Socket.setTcpNoDelay(boolean), Connection

resetToDefault

public void resetToDefault()
Description copied from interface: Settings

Resets the settings of current instance to the default settings.

Specified by:
resetToDefault in interface Settings

setDefaultMaxPersistentConnections

public static void setDefaultMaxPersistentConnections(int maxPersistentConnections)
                                               throws IllegalArgumentException

Set the default max number of simultaneous PersistentConnections allowed to the specified maxPersistentConnections (recommendation is 4).

That is, every new instance of ConnectionManagerSettings will have the max PersistentConnections set to the specified maxPersistentConnections.

This method sets the ice.net.maxPersistentConnections property for the current runtime.

Note: The max number of simultaneous persistent connections "must" be at least 2, or ICEbrowser will deadlock on most web pages!

Parameters:
maxPersistentConnections - the new max persistent connections.
Throws:
IllegalArgumentException - if the specified maxPersistentConnections is less than -1.
See Also:
getDefaultMaxPersistentConnections(), getMaxPersistentConnections(), PersistentConnection

setDefaultNagleEnabled

public static void setDefaultNagleEnabled(boolean nagleEnabled)

setDefaultPersistentConnectionsEnabled

public static void setDefaultPersistentConnectionsEnabled(boolean persistentConnectionsEnabled)

setDefaultPersistentConnectionTimeout

public static void setDefaultPersistentConnectionTimeout(int persistentConnectionTimeout)
                                                  throws IllegalArgumentException
Throws:
IllegalArgumentException

setDefaultReadBufferSize

public static void setDefaultReadBufferSize(int readBufferSize)
                                     throws IllegalArgumentException
Throws:
IllegalArgumentException

setDefaultSoTimeout

public static void setDefaultSoTimeout(int soTimeout)
                                throws IllegalArgumentException
Throws:
IllegalArgumentException

setMaxPersistentConnections

public void setMaxPersistentConnections(int maxPersistentConnections)
                                 throws IllegalArgumentException

Set the max number of simultaneous persistent connections allowed (recommendation is 4).

Note: The max number of simultaneous persistent connections must be at least 2, or ICEbrowser will deadlock on most web pages!

Parameters:
maxPersistentConnections -
Throws:
IllegalArgumentException

setNagleEnabled

public void setNagleEnabled(boolean nagleEnabled)

setPersistentConnectionsEnabled

public void setPersistentConnectionsEnabled(boolean persistentConnectionsEnabled)

setPersistentConnectionTimeout

public void setPersistentConnectionTimeout(int persistentConnectionTimeout)
                                    throws IllegalArgumentException
Throws:
IllegalArgumentException

setReadBufferSize

public void setReadBufferSize(int readBufferSize)
                       throws IllegalArgumentException
Throws:
IllegalArgumentException

setSoTimeout

public void setSoTimeout(int soTimeout)
                  throws IllegalArgumentException
Throws:
IllegalArgumentException

toString

public String toString()