public class Nio2Endpoint extends AbstractJsseEndpoint<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 class |
Nio2Endpoint.Nio2SocketWrapper |
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.BindState, AbstractEndpoint.Handler<S>
acceptors, acceptorThreadCount, acceptorThreadPriority, attributes, internalExecutor, negotiableProtocols, paused, processorCache, running, sm, socketProperties, sslHostConfigs, threadPriority
Constructor and Description |
---|
Nio2Endpoint() |
Modifier and Type | Method and Description |
---|---|
void |
bind()
Initialize the endpoint.
|
protected AbstractEndpoint.Acceptor |
createAcceptor()
Hook to allow Endpoints to provide a specific Acceptor implementation.
|
protected SocketProcessorBase<Nio2Channel> |
createSocketProcessor(SocketWrapperBase<Nio2Channel> socketWrapper,
SocketEvent event) |
protected void |
doCloseServerSocket()
Actually close the server socket but don't perform any other clean-up.
|
static void |
endInline() |
boolean |
getDeferAccept()
Is deferAccept supported?
|
int |
getKeepAliveCount()
Number of keep-alive sockets.
|
protected Log |
getLog() |
int |
getReadBufSize() |
protected NetworkChannel |
getServerSocket() |
int |
getWriteBufSize() |
static boolean |
isInline() |
protected boolean |
setSocketOptions(AsynchronousSocketChannel socket)
Process the specified connection.
|
void |
setSocketProperties(SocketProperties socketProperties) |
void |
shutdownExecutor() |
static void |
startInline() |
void |
startInternal()
Start the NIO2 endpoint, creating acceptor.
|
void |
stopInternal()
Stop the endpoint.
|
void |
unbind()
Deallocate NIO memory pools, and close server socket.
|
createSSLContext, createSSLEngine, getLocalAddress, getSniParseLimit, getSslImplementation, getSslImplementationName, init, initialiseSsl, isAlpnSupported, setSniParseLimit, setSslImplementationName
addNegotiatedProtocol, addSslHostConfig, addSslHostConfig, closeServerSocketGraceful, countDownConnection, countUpOrAwaitConnection, createExecutor, destroy, destroySsl, findSslHostConfigs, getAcceptCount, getAcceptorThreadCount, getAcceptorThreadPriority, getAddress, getAttribute, getBacklog, getBindOnInit, getConnectionCount, getConnectionLinger, getConnectionTimeout, getCurrentThreadCount, getCurrentThreadsBusy, getDaemon, getDefaultSSLHostConfigName, getDomain, getExecutor, getExecutorTerminationTimeoutMillis, getHandler, getKeepAliveTimeout, getLocalPort, getMaxConnections, getMaxHeaderCount, getMaxKeepAliveRequests, getMaxThreads, getMinSpareThreads, getName, getPort, getProperty, getSocketProperties, getSoLinger, getSoTimeout, getSSLHostConfig, getTcpNoDelay, getThreadPriority, getUseAsyncIO, getUseSendfile, handleExceptionWithDelay, hasNegotiableProtocols, initializeConnectionLatch, isPaused, isRunning, isSSLEnabled, pause, processSocket, releaseConnectionLatch, releaseSSLContext, reloadSslHostConfig, reloadSslHostConfigs, removeSslHostConfig, resume, setAcceptCount, setAcceptorThreadCount, setAcceptorThreadPriority, setAddress, setAttribute, setBacklog, setBindOnInit, setConnectionLinger, setConnectionTimeout, setDaemon, setDefaultSSLHostConfigName, setDomain, setExecutor, setExecutorTerminationTimeoutMillis, setHandler, setKeepAliveTimeout, setMaxConnections, setMaxHeaderCount, setMaxKeepAliveRequests, setMaxThreads, setMinSpareThreads, setName, setPort, setProperty, setSoLinger, setSoTimeout, setSSLEnabled, setTcpNoDelay, setThreadPriority, setUseAsyncIO, setUseSendfile, start, startAcceptorThreads, stop, toTimeout, unlockAccept
public void setSocketProperties(SocketProperties socketProperties)
public boolean getDeferAccept()
getDeferAccept
in class AbstractEndpoint<Nio2Channel>
public int getKeepAliveCount()
public void bind() throws Exception
bind
in class AbstractEndpoint<Nio2Channel>
Exception
public void startInternal() throws Exception
startInternal
in class AbstractEndpoint<Nio2Channel>
Exception
public void stopInternal()
stopInternal
in class AbstractEndpoint<Nio2Channel>
public void unbind() throws Exception
unbind
in class AbstractJsseEndpoint<Nio2Channel>
Exception
protected void doCloseServerSocket() throws IOException
AbstractEndpoint
doCloseServerSocket
in class AbstractEndpoint<Nio2Channel>
IOException
- If an error occurs closing the socketpublic void shutdownExecutor()
shutdownExecutor
in class AbstractEndpoint<Nio2Channel>
public int getWriteBufSize()
public int getReadBufSize()
protected AbstractEndpoint.Acceptor createAcceptor()
AbstractEndpoint
createAcceptor
in class AbstractEndpoint<Nio2Channel>
protected boolean setSocketOptions(AsynchronousSocketChannel socket)
socket
- The socket channeltrue
if the socket was correctly configured
and processing may continue, false
if the socket needs to be
close immediatelyprotected SocketProcessorBase<Nio2Channel> createSocketProcessor(SocketWrapperBase<Nio2Channel> socketWrapper, SocketEvent event)
createSocketProcessor
in class AbstractEndpoint<Nio2Channel>
protected Log getLog()
getLog
in class AbstractEndpoint<Nio2Channel>
protected NetworkChannel getServerSocket()
getServerSocket
in class AbstractJsseEndpoint<Nio2Channel>
public static void startInline()
public static void endInline()
public static boolean isInline()
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.