org.apache.http.impl.nio.reactor
Class IOReactorConfig

java.lang.Object
  extended by org.apache.http.impl.nio.reactor.IOReactorConfig
All Implemented Interfaces:
Cloneable

@NotThreadSafe
public final class IOReactorConfig
extends Object
implements Cloneable

I/O reactor configuration parameters.

Since:
4.2

Constructor Summary
IOReactorConfig()
           
 
Method Summary
protected  IOReactorConfig clone()
           
 int getConnectTimeout()
          Determines the default connect timeout value for non-blocking connection requests.
 int getIoThreadCount()
          Determines the number of I/O dispatch threads to be used by the I/O reactor.
 int getRcvBufSize()
          Determines the default value of the SocketOptions.SO_RCVBUF parameter for newly created sockets.
 long getSelectInterval()
          Determines time interval in milliseconds at which the I/O reactor wakes up to check for timed out sessions and session requests.
 long getShutdownGracePeriod()
          Determines grace period in milliseconds the I/O reactors are expected to block waiting for individual worker threads to terminate cleanly.
 int getSndBufSize()
          Determines the default value of the SocketOptions.SO_SNDBUF parameter for newly created sockets.
 int getSoLinger()
          Determines the default value of the SocketOptions.SO_LINGER parameter for newly created sockets.
 int getSoTimeout()
          Determines the default socket timeout value for non-blocking I/O operations.
 boolean isInterestOpQueued()
          Determines whether or not I/O interest operations are to be queued and executed asynchronously by the I/O reactor thread or to be applied to the underlying SelectionKey immediately.
 boolean isSoKeepalive()
          Determines the default value of the SocketOptions.SO_KEEPALIVE parameter for newly created sockets.
 boolean isSoReuseAddress()
          Determines the default value of the SocketOptions.SO_REUSEADDR parameter for newly created sockets.
 boolean isTcpNoDelay()
          Determines the default value of the SocketOptions.TCP_NODELAY parameter for newly created sockets.
 void setConnectTimeout(int connectTimeout)
          Defines the default connect timeout value for non-blocking connection requests.
 void setInterestOpQueued(boolean interestOpQueued)
          Defines whether or not I/O interest operations are to be queued and executed asynchronously by the I/O reactor thread or to be applied to the underlying SelectionKey immediately.
 void setIoThreadCount(int ioThreadCount)
          Defines the number of I/O dispatch threads to be used by the I/O reactor.
 void setRcvBufSize(int rcvBufSize)
          Defines the default value of the SocketOptions.SO_RCVBUF parameter for newly created sockets.
 void setSelectInterval(long selectInterval)
          Defines time interval in milliseconds at which the I/O reactor wakes up to check for timed out sessions and session requests.
 void setShutdownGracePeriod(long gracePeriod)
          Defines grace period in milliseconds the I/O reactors are expected to block waiting for individual worker threads to terminate cleanly.
 void setSndBufSize(int sndBufSize)
          Defines the default value of the SocketOptions.SO_SNDBUF parameter for newly created sockets.
 void setSoKeepalive(boolean soKeepAlive)
          Defines the default value of the SocketOptions.SO_KEEPALIVE parameter for newly created sockets.
 void setSoLinger(int soLinger)
          Defines the default value of the SocketOptions.SO_LINGER parameter for newly created sockets.
 void setSoReuseAddress(boolean soReuseAddress)
          Defines the default value of the SocketOptions.SO_REUSEADDR parameter for newly created sockets.
 void setSoTimeout(int soTimeout)
          Defines the default socket timeout value for non-blocking I/O operations.
 void setTcpNoDelay(boolean tcpNoDelay)
          Defines the default value of the SocketOptions.TCP_NODELAY parameter for newly created sockets.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IOReactorConfig

public IOReactorConfig()
Method Detail

getSelectInterval

public long getSelectInterval()
Determines time interval in milliseconds at which the I/O reactor wakes up to check for timed out sessions and session requests.

Default: 1000 milliseconds.


setSelectInterval

public void setSelectInterval(long selectInterval)
Defines time interval in milliseconds at which the I/O reactor wakes up to check for timed out sessions and session requests. May not be negative or zero.


getShutdownGracePeriod

public long getShutdownGracePeriod()
Determines grace period in milliseconds the I/O reactors are expected to block waiting for individual worker threads to terminate cleanly.

Default: 500 milliseconds.


setShutdownGracePeriod

public void setShutdownGracePeriod(long gracePeriod)
Defines grace period in milliseconds the I/O reactors are expected to block waiting for individual worker threads to terminate cleanly. May not be negative or zero.


isInterestOpQueued

public boolean isInterestOpQueued()
Determines whether or not I/O interest operations are to be queued and executed asynchronously by the I/O reactor thread or to be applied to the underlying SelectionKey immediately.

Default: false

See Also:
SelectionKey, SelectionKey.interestOps(), SelectionKey.interestOps(int)

setInterestOpQueued

public void setInterestOpQueued(boolean interestOpQueued)
Defines whether or not I/O interest operations are to be queued and executed asynchronously by the I/O reactor thread or to be applied to the underlying SelectionKey immediately.

See Also:
SelectionKey, SelectionKey.interestOps(), SelectionKey.interestOps(int)

getIoThreadCount

public int getIoThreadCount()
Determines the number of I/O dispatch threads to be used by the I/O reactor.

Default: 2


setIoThreadCount

public void setIoThreadCount(int ioThreadCount)
Defines the number of I/O dispatch threads to be used by the I/O reactor. May not be negative or zero.


getSoTimeout

public int getSoTimeout()
Determines the default socket timeout value for non-blocking I/O operations.

Default: 0 (no timeout)

See Also:
SocketOptions.SO_TIMEOUT

setSoTimeout

public void setSoTimeout(int soTimeout)
Defines the default socket timeout value for non-blocking I/O operations.

Default: 0 (no timeout)

See Also:
SocketOptions.SO_TIMEOUT

isSoReuseAddress

public boolean isSoReuseAddress()
Determines the default value of the SocketOptions.SO_REUSEADDR parameter for newly created sockets.

Default: false

See Also:
SocketOptions.SO_REUSEADDR

setSoReuseAddress

public void setSoReuseAddress(boolean soReuseAddress)
Defines the default value of the SocketOptions.SO_REUSEADDR parameter for newly created sockets.

See Also:
SocketOptions.SO_REUSEADDR

getSoLinger

public int getSoLinger()
Determines the default value of the SocketOptions.SO_LINGER parameter for newly created sockets.

Default: -1

See Also:
SocketOptions.SO_LINGER

setSoLinger

public void setSoLinger(int soLinger)
Defines the default value of the SocketOptions.SO_LINGER parameter for newly created sockets.

See Also:
SocketOptions.SO_LINGER

isSoKeepalive

public boolean isSoKeepalive()
Determines the default value of the SocketOptions.SO_KEEPALIVE parameter for newly created sockets.

Default: -1

See Also:
SocketOptions.SO_KEEPALIVE

setSoKeepalive

public void setSoKeepalive(boolean soKeepAlive)
Defines the default value of the SocketOptions.SO_KEEPALIVE parameter for newly created sockets.

Default: -1

See Also:
SocketOptions.SO_KEEPALIVE

isTcpNoDelay

public boolean isTcpNoDelay()
Determines the default value of the SocketOptions.TCP_NODELAY parameter for newly created sockets.

Default: false

See Also:
SocketOptions.TCP_NODELAY

setTcpNoDelay

public void setTcpNoDelay(boolean tcpNoDelay)
Defines the default value of the SocketOptions.TCP_NODELAY parameter for newly created sockets.

See Also:
SocketOptions.TCP_NODELAY

getConnectTimeout

public int getConnectTimeout()
Determines the default connect timeout value for non-blocking connection requests.

Default: 0 (no timeout)


setConnectTimeout

public void setConnectTimeout(int connectTimeout)
Defines the default connect timeout value for non-blocking connection requests.


getSndBufSize

public int getSndBufSize()
Determines the default value of the SocketOptions.SO_SNDBUF parameter for newly created sockets.

Default: 0 (system default)

See Also:
SocketOptions.SO_SNDBUF

setSndBufSize

public void setSndBufSize(int sndBufSize)
Defines the default value of the SocketOptions.SO_SNDBUF parameter for newly created sockets.

See Also:
SocketOptions.SO_SNDBUF

getRcvBufSize

public int getRcvBufSize()
Determines the default value of the SocketOptions.SO_RCVBUF parameter for newly created sockets.

Default: 0 (system default)

See Also:
SocketOptions.SO_RCVBUF

setRcvBufSize

public void setRcvBufSize(int rcvBufSize)
Defines the default value of the SocketOptions.SO_RCVBUF parameter for newly created sockets.

See Also:
SocketOptions.SO_RCVBUF

clone

protected IOReactorConfig clone()
                         throws CloneNotSupportedException
Overrides:
clone in class Object
Throws:
CloneNotSupportedException

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2005-2013 The Apache Software Foundation. All Rights Reserved.