public class Nio2Endpoint extends AbstractEndpoint<Nio2Channel>
Modifier and Type | Class and Description |
---|---|
protected class |
Nio2Endpoint.Acceptor
With NIO2, the main acceptor thread only initiates the initial accept
but periodically checks that the connector is still accepting (if not
it will attempt to start again).
|
static interface |
Nio2Endpoint.Handler
Bare bones interface used for socket processing.
|
static class |
Nio2Endpoint.Nio2SocketWrapper |
static class |
Nio2Endpoint.NioBufferHandler |
static class |
Nio2Endpoint.SendfileData
SendfileData class.
|
protected class |
Nio2Endpoint.SocketProcessor
This class is the equivalent of the Worker, but will simply use in an
external Executor thread pool.
|
AbstractEndpoint.AsyncTimeout, AbstractEndpoint.BindState
acceptors, acceptorThreadCount, acceptorThreadPriority, attributes, DEFAULT_CIPHERS, internalExecutor, paused, running, sm, socketProperties, threadPriority, waitingRequests
Constructor and Description |
---|
Nio2Endpoint() |
Modifier and Type | Method and Description |
---|---|
void |
addTimeout(SocketWrapper<Nio2Channel> socket) |
void |
awaitBytes(SocketWrapper<Nio2Channel> socket) |
void |
bind()
Initialize the endpoint.
|
protected void |
checkParachute() |
void |
closeSocket(SocketWrapper<Nio2Channel> socket,
SocketStatus status) |
protected AbstractEndpoint.Acceptor |
createAcceptor()
Hook to allow Endpoints to provide a specific Acceptor implementation.
|
protected javax.net.ssl.SSLEngine |
createSSLEngine() |
static void |
endInline() |
java.lang.String[] |
getCiphersUsed() |
boolean |
getDeferAccept()
Is deferAccept supported?
|
Nio2Endpoint.Handler |
getHandler() |
int |
getKeepAliveCount()
Number of keepalive sockets.
|
int |
getLocalPort()
Port in use.
|
protected Log |
getLog() |
int |
getOomParachute() |
byte[] |
getOomParachuteData() |
int |
getPollerThreadPriority() |
int |
getReadBufSize() |
javax.net.ssl.SSLContext |
getSSLContext() |
boolean |
getUseCaches() |
boolean |
getUseComet() |
boolean |
getUseCometTimeout() |
boolean |
getUsePolling() |
boolean |
getUseSendfile() |
int |
getWriteBufSize() |
static boolean |
isInline() |
protected boolean |
isWorkerAvailable()
Returns true if a worker thread is available for processing.
|
SendfileState |
processSendfile(Nio2Endpoint.Nio2SocketWrapper socket) |
void |
processSocket(SocketWrapper<Nio2Channel> socketWrapper,
SocketStatus socketStatus,
boolean dispatch)
Process the given SocketWrapper with the given status.
|
protected boolean |
processSocket0(SocketWrapper<Nio2Channel> socketWrapper,
SocketStatus status,
boolean dispatch) |
protected boolean |
reclaimParachute(boolean force) |
protected void |
releaseCaches() |
boolean |
removeTimeout(SocketWrapper<Nio2Channel> socket) |
void |
setHandler(Nio2Endpoint.Handler handler) |
void |
setOomParachute(int oomParachute) |
void |
setOomParachuteData(byte[] oomParachuteData) |
void |
setPollerThreadPriority(int pollerThreadPriority) |
protected boolean |
setSocketOptions(java.nio.channels.AsynchronousSocketChannel socket)
Process the specified connection.
|
void |
setSocketProperties(SocketProperties socketProperties) |
void |
setSSLContext(javax.net.ssl.SSLContext c) |
void |
setUseCaches(boolean useCaches) |
void |
setUseComet(boolean useComet) |
void |
setUseSendfile(boolean useSendfile) |
void |
shutdownExecutor() |
static void |
startInline() |
void |
startInternal()
Start the NIO endpoint, creating acceptor, poller threads.
|
void |
stopInternal()
Stop the endpoint.
|
void |
unbind()
Deallocate NIO memory pools, and close server socket.
|
javax.net.ssl.KeyManager[] |
wrap(javax.net.ssl.KeyManager[] managers) |
configureUseServerCipherSuitesOrder, countDownConnection, countUpOrAwaitConnection, createExecutor, destroy, executeNonBlockingDispatches, getAcceptorThreadCount, getAcceptorThreadPriority, getAddress, getAlgorithm, getAllowUnsafeLegacyRenegotiation, getAsyncTimeout, getAttribute, getBacklog, getBindOnInit, getCiphers, getClientAuth, getConnectionCount, getCrlFile, getCurrentThreadCount, getCurrentThreadsBusy, getDaemon, getExecutor, getExecutorTerminationTimeoutMillis, getKeepAliveTimeout, getKeyAlias, getKeyPass, getKeystoreFile, getKeystorePass, getKeystoreProvider, getKeystoreType, getMaxConnections, getMaxHeaderCount, getMaxKeepAliveRequests, getMaxThreads, getMaxThreadsInternal, getMaxThreadsWithExecutor, getMinSpareThreads, getName, getPort, getProperty, getSessionCacheSize, getSessionTimeout, getSocketProperties, getSoLinger, getSoTimeout, getSslEnabledProtocolsArray, getSslProtocol, getTcpNoDelay, getThreadPriority, getTrustManagerClassName, getTrustMaxCertLength, getTruststoreAlgorithm, getTruststoreFile, getTruststorePass, getTruststoreProvider, getTruststoreType, getUseServerCipherSuitesOrder, handleExceptionWithDelay, init, initializeConnectionLatch, isPaused, isRunning, isSSLEnabled, pause, releaseConnectionLatch, removeWaitingRequest, resume, setAcceptorThreadCount, setAcceptorThreadPriority, setAddress, setAlgorithm, setAllowUnsafeLegacyRenegotiation, setAsyncTimeout, setAttribute, setBacklog, setBindOnInit, setCiphers, setClientAuth, setCrlFile, setDaemon, setExecutor, setExecutorTerminationTimeoutMillis, setKeepAliveTimeout, setKeyAlias, setKeyPass, setKeystoreFile, setKeystorePass, setKeystoreProvider, setKeystoreType, setMaxConnections, setMaxHeaderCount, setMaxKeepAliveRequests, setMaxThreads, setMinSpareThreads, setName, setPort, setProperty, setSessionCacheSize, setSessionTimeout, setSoLinger, setSoTimeout, setSSLEnabled, setSslEnabledProtocols, setSslProtocol, setTcpNoDelay, setThreadPriority, setTrustManagerClassName, setTrustMaxCertLength, setTruststoreAlgorithm, setTruststoreFile, setTruststorePass, setTruststoreProvider, setTruststoreType, setUseServerCipherSuitesOrder, start, startAcceptorThreads, stop, testServerCipherSuitesOrderSupport, unlockAccept
public void setUseCaches(boolean useCaches)
public boolean getUseCaches()
public void setPollerThreadPriority(int pollerThreadPriority)
public int getPollerThreadPriority()
public void setHandler(Nio2Endpoint.Handler handler)
public Nio2Endpoint.Handler getHandler()
public void setUseComet(boolean useComet)
public boolean getUseComet()
getUseComet
in class AbstractEndpoint<Nio2Channel>
public boolean getUseCometTimeout()
getUseCometTimeout
in class AbstractEndpoint<Nio2Channel>
public boolean getUsePolling()
getUsePolling
in class AbstractEndpoint<Nio2Channel>
public void setSocketProperties(SocketProperties socketProperties)
public void setUseSendfile(boolean useSendfile)
public boolean getDeferAccept()
getDeferAccept
in class AbstractEndpoint<Nio2Channel>
public void setOomParachute(int oomParachute)
public void setOomParachuteData(byte[] oomParachuteData)
public javax.net.ssl.SSLContext getSSLContext()
public void setSSLContext(javax.net.ssl.SSLContext c)
public int getLocalPort()
getLocalPort
in class AbstractEndpoint<Nio2Channel>
public java.lang.String[] getCiphersUsed()
getCiphersUsed
in class AbstractEndpoint<Nio2Channel>
protected void checkParachute()
protected boolean reclaimParachute(boolean force)
protected void releaseCaches()
public int getKeepAliveCount()
public void bind() throws java.lang.Exception
bind
in class AbstractEndpoint<Nio2Channel>
java.lang.Exception
public javax.net.ssl.KeyManager[] wrap(javax.net.ssl.KeyManager[] managers)
public void startInternal() throws java.lang.Exception
startInternal
in class AbstractEndpoint<Nio2Channel>
java.lang.Exception
public void stopInternal()
stopInternal
in class AbstractEndpoint<Nio2Channel>
public void unbind() throws java.lang.Exception
unbind
in class AbstractEndpoint<Nio2Channel>
java.lang.Exception
public void shutdownExecutor()
shutdownExecutor
in class AbstractEndpoint<Nio2Channel>
public int getWriteBufSize()
public int getReadBufSize()
public boolean getUseSendfile()
getUseSendfile
in class AbstractEndpoint<Nio2Channel>
public int getOomParachute()
public byte[] getOomParachuteData()
protected AbstractEndpoint.Acceptor createAcceptor()
AbstractEndpoint
createAcceptor
in class AbstractEndpoint<Nio2Channel>
protected boolean setSocketOptions(java.nio.channels.AsynchronousSocketChannel socket)
protected javax.net.ssl.SSLEngine createSSLEngine()
protected boolean isWorkerAvailable()
public void processSocket(SocketWrapper<Nio2Channel> socketWrapper, SocketStatus socketStatus, boolean dispatch)
AbstractEndpoint
processSocket
in class AbstractEndpoint<Nio2Channel>
socketWrapper
- The socket wrapper to processsocketStatus
- The input status to the processingdispatch
- Should the processing be performed on a new
container threadprotected boolean processSocket0(SocketWrapper<Nio2Channel> socketWrapper, SocketStatus status, boolean dispatch)
public void closeSocket(SocketWrapper<Nio2Channel> socket, SocketStatus status)
protected Log getLog()
getLog
in class AbstractEndpoint<Nio2Channel>
public void addTimeout(SocketWrapper<Nio2Channel> socket)
public boolean removeTimeout(SocketWrapper<Nio2Channel> socket)
public static void startInline()
public static void endInline()
public static boolean isInline()
public void awaitBytes(SocketWrapper<Nio2Channel> socket)
public SendfileState processSendfile(Nio2Endpoint.Nio2SocketWrapper socket)
Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.