Package org.apache.http.impl.nio.reactor
Class IOReactorConfig
- java.lang.Object
-
- org.apache.http.impl.nio.reactor.IOReactorConfig
-
- All Implemented Interfaces:
java.lang.Cloneable
public final class IOReactorConfig extends java.lang.Object implements java.lang.CloneableI/O reactor configuration parameters.- Since:
- 4.2
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classIOReactorConfig.Builder
-
Field Summary
Fields Modifier and Type Field Description private intbacklogSizeprivate intconnectTimeoutstatic IOReactorConfigDEFAULTprivate booleaninterestOpQueuedprivate intioThreadCountprivate intrcvBufSizeprivate longselectIntervalprivate longshutdownGracePeriodprivate intsndBufSizeprivate booleansoKeepAliveprivate intsoLingerprivate booleansoReuseAddressprivate intsoTimeoutprivate booleantcpNoDelay
-
Constructor Summary
Constructors Constructor Description IOReactorConfig()Deprecated.IOReactorConfig(long selectInterval, long shutdownGracePeriod, boolean interestOpQueued, int ioThreadCount, int soTimeout, boolean soReuseAddress, int soLinger, boolean soKeepAlive, boolean tcpNoDelay, int connectTimeout, int sndBufSize, int rcvBufSize, int backlogSize)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected IOReactorConfigclone()static IOReactorConfig.Buildercopy(IOReactorConfig config)static IOReactorConfig.Buildercustom()intgetBacklogSize()Determines the default backlog size value for server sockets binds.intgetConnectTimeout()Determines the default connect timeout value for non-blocking connection requests.intgetIoThreadCount()Determines the number of I/O dispatch threads to be used by the I/O reactor.intgetRcvBufSize()Determines the default value of theSocketOptions.SO_RCVBUFparameter for newly created sockets.longgetSelectInterval()Determines time interval in milliseconds at which the I/O reactor wakes up to check for timed out sessions and session requests.longgetShutdownGracePeriod()Determines grace period in milliseconds the I/O reactors are expected to block waiting for individual worker threads to terminate cleanly.intgetSndBufSize()Determines the default value of theSocketOptions.SO_SNDBUFparameter for newly created sockets.intgetSoLinger()Determines the default value of theSocketOptions.SO_LINGERparameter for newly created sockets.intgetSoTimeout()Determines the default socket timeout value for non-blocking I/O operations.booleanisInterestOpQueued()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 underlyingSelectionKeyimmediately.booleanisSoKeepalive()Determines the default value of theSocketOptions.SO_KEEPALIVEparameter for newly created sockets.booleanisSoReuseAddress()Determines the default value of theSocketOptions.SO_REUSEADDRparameter for newly created sockets.booleanisTcpNoDelay()Determines the default value of theSocketOptions.TCP_NODELAYparameter for newly created sockets.voidsetConnectTimeout(int connectTimeout)Deprecated.voidsetInterestOpQueued(boolean interestOpQueued)Deprecated.voidsetIoThreadCount(int ioThreadCount)Deprecated.voidsetRcvBufSize(int rcvBufSize)Deprecated.voidsetSelectInterval(long selectInterval)Deprecated.voidsetShutdownGracePeriod(long gracePeriod)Deprecated.voidsetSndBufSize(int sndBufSize)Deprecated.voidsetSoKeepalive(boolean soKeepAlive)Deprecated.voidsetSoLinger(int soLinger)Deprecated.(4.3) useIOReactorConfig.Builder.setSoLinger(int)voidsetSoReuseAddress(boolean soReuseAddress)Deprecated.voidsetSoTimeout(int soTimeout)Deprecated.voidsetTcpNoDelay(boolean tcpNoDelay)Deprecated.java.lang.StringtoString()
-
-
-
Field Detail
-
DEFAULT
public static final IOReactorConfig DEFAULT
-
selectInterval
private long selectInterval
-
shutdownGracePeriod
private long shutdownGracePeriod
-
interestOpQueued
private boolean interestOpQueued
-
ioThreadCount
private int ioThreadCount
-
soTimeout
private int soTimeout
-
soReuseAddress
private boolean soReuseAddress
-
soLinger
private int soLinger
-
soKeepAlive
private boolean soKeepAlive
-
tcpNoDelay
private boolean tcpNoDelay
-
connectTimeout
private int connectTimeout
-
sndBufSize
private int sndBufSize
-
rcvBufSize
private int rcvBufSize
-
backlogSize
private final int backlogSize
-
-
Constructor Detail
-
IOReactorConfig
@Deprecated public IOReactorConfig()
Deprecated.
-
IOReactorConfig
IOReactorConfig(long selectInterval, long shutdownGracePeriod, boolean interestOpQueued, int ioThreadCount, int soTimeout, boolean soReuseAddress, int soLinger, boolean soKeepAlive, boolean tcpNoDelay, int connectTimeout, int sndBufSize, int rcvBufSize, int backlogSize)
-
-
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:
1000milliseconds.
-
setSelectInterval
@Deprecated public void setSelectInterval(long selectInterval)
Deprecated.
-
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:
500milliseconds.
-
setShutdownGracePeriod
@Deprecated public void setShutdownGracePeriod(long gracePeriod)
Deprecated.
-
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 underlyingSelectionKeyimmediately.Default:
false- See Also:
SelectionKey,SelectionKey.interestOps(),SelectionKey.interestOps(int)
-
setInterestOpQueued
@Deprecated public void setInterestOpQueued(boolean interestOpQueued)
Deprecated.
-
getIoThreadCount
public int getIoThreadCount()
Determines the number of I/O dispatch threads to be used by the I/O reactor.Default:
2
-
setIoThreadCount
@Deprecated public void setIoThreadCount(int ioThreadCount)
Deprecated.
-
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
@Deprecated public void setSoTimeout(int soTimeout)
Deprecated.
-
isSoReuseAddress
public boolean isSoReuseAddress()
Determines the default value of theSocketOptions.SO_REUSEADDRparameter for newly created sockets.Default:
false- See Also:
SocketOptions.SO_REUSEADDR
-
setSoReuseAddress
@Deprecated public void setSoReuseAddress(boolean soReuseAddress)
Deprecated.
-
getSoLinger
public int getSoLinger()
Determines the default value of theSocketOptions.SO_LINGERparameter for newly created sockets.Default:
-1- See Also:
SocketOptions.SO_LINGER
-
setSoLinger
@Deprecated public void setSoLinger(int soLinger)
Deprecated.(4.3) useIOReactorConfig.Builder.setSoLinger(int)
-
isSoKeepalive
public boolean isSoKeepalive()
Determines the default value of theSocketOptions.SO_KEEPALIVEparameter for newly created sockets.Default:
-1- See Also:
SocketOptions.SO_KEEPALIVE
-
setSoKeepalive
@Deprecated public void setSoKeepalive(boolean soKeepAlive)
Deprecated.
-
isTcpNoDelay
public boolean isTcpNoDelay()
Determines the default value of theSocketOptions.TCP_NODELAYparameter for newly created sockets.Default:
false- See Also:
SocketOptions.TCP_NODELAY
-
setTcpNoDelay
@Deprecated public void setTcpNoDelay(boolean tcpNoDelay)
Deprecated.
-
getConnectTimeout
public int getConnectTimeout()
Determines the default connect timeout value for non-blocking connection requests.Default:
0(no timeout)
-
setConnectTimeout
@Deprecated public void setConnectTimeout(int connectTimeout)
Deprecated.
-
getSndBufSize
public int getSndBufSize()
Determines the default value of theSocketOptions.SO_SNDBUFparameter for newly created sockets.Default:
0(system default)- See Also:
SocketOptions.SO_SNDBUF
-
setSndBufSize
@Deprecated public void setSndBufSize(int sndBufSize)
Deprecated.
-
getRcvBufSize
public int getRcvBufSize()
Determines the default value of theSocketOptions.SO_RCVBUFparameter for newly created sockets.Default:
0(system default)- See Also:
SocketOptions.SO_RCVBUF
-
setRcvBufSize
@Deprecated public void setRcvBufSize(int rcvBufSize)
Deprecated.
-
getBacklogSize
public int getBacklogSize()
Determines the default backlog size value for server sockets binds.Default:
0(system default)- Since:
- 4.4
-
clone
protected IOReactorConfig clone() throws java.lang.CloneNotSupportedException
- Overrides:
clonein classjava.lang.Object- Throws:
java.lang.CloneNotSupportedException
-
custom
public static IOReactorConfig.Builder custom()
-
copy
public static IOReactorConfig.Builder copy(IOReactorConfig config)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-