public class NioEndpoint extends AbstractJsseEndpoint<NioChannel>
| Modifier and Type | Class and Description |
|---|---|
protected class |
NioEndpoint.Acceptor
The background thread that listens for incoming TCP/IP connections and
hands them off to an appropriate processor.
|
static class |
NioEndpoint.NioSocketWrapper |
class |
NioEndpoint.Poller
Poller class.
|
static class |
NioEndpoint.PollerEvent
PollerEvent, cacheable object for poller events to avoid GC
|
static class |
NioEndpoint.SendfileData
SendfileData class.
|
protected class |
NioEndpoint.SocketProcessor
This class is the equivalent of the Worker, but will simply use in an
external Executor thread pool.
|
AbstractEndpoint.BindState, AbstractEndpoint.Handler<S>| Modifier and Type | Field and Description |
|---|---|
static int |
OP_REGISTER |
acceptors, acceptorThreadCount, acceptorThreadPriority, attributes, internalExecutor, negotiableProtocols, paused, processorCache, running, sm, socketProperties, sslHostConfigs, threadPriority| Constructor and Description |
|---|
NioEndpoint() |
| 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<NioChannel> |
createSocketProcessor(SocketWrapperBase<NioChannel> socketWrapper,
SocketEvent event) |
protected void |
doCloseServerSocket()
Actually close the server socket but don't perform any other clean-up.
|
boolean |
getDeferAccept()
Is deferAccept supported?
|
int |
getKeepAliveCount()
Number of keep-alive sockets.
|
protected Log |
getLog() |
NioEndpoint.Poller |
getPoller0()
Return an available poller in true round robin fashion.
|
int |
getPollerThreadCount() |
int |
getPollerThreadPriority() |
int |
getReadBufSize() |
NioSelectorPool |
getSelectorPool() |
long |
getSelectorTimeout() |
protected NetworkChannel |
getServerSocket() |
protected CountDownLatch |
getStopLatch() |
boolean |
getUseInheritedChannel() |
int |
getWriteBufSize() |
void |
setPollerThreadCount(int pollerThreadCount) |
void |
setPollerThreadPriority(int pollerThreadPriority) |
boolean |
setProperty(String name,
String value)
Generic properties, introspected
|
void |
setSelectorPool(NioSelectorPool selectorPool) |
void |
setSelectorTimeout(long timeout) |
protected boolean |
setSocketOptions(SocketChannel socket)
Process the specified connection.
|
void |
setSocketProperties(SocketProperties socketProperties) |
protected void |
setStopLatch(CountDownLatch stopLatch) |
void |
setUseInheritedChannel(boolean useInheritedChannel) |
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.
|
createSSLContext, createSSLEngine, getLocalAddress, getSniParseLimit, getSslImplementation, getSslImplementationName, init, initialiseSsl, isAlpnSupported, setSniParseLimit, setSslImplementationNameaddNegotiatedProtocol, 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, setSoLinger, setSoTimeout, setSSLEnabled, setTcpNoDelay, setThreadPriority, setUseAsyncIO, setUseSendfile, shutdownExecutor, start, startAcceptorThreads, stop, toTimeout, unlockAcceptpublic static final int OP_REGISTER
public boolean setProperty(String name, String value)
setProperty in class AbstractEndpoint<NioChannel>public void setUseInheritedChannel(boolean useInheritedChannel)
public boolean getUseInheritedChannel()
public void setPollerThreadPriority(int pollerThreadPriority)
public int getPollerThreadPriority()
public void setPollerThreadCount(int pollerThreadCount)
public int getPollerThreadCount()
public void setSelectorTimeout(long timeout)
public long getSelectorTimeout()
public NioEndpoint.Poller getPoller0()
public void setSelectorPool(NioSelectorPool selectorPool)
public void setSocketProperties(SocketProperties socketProperties)
public boolean getDeferAccept()
getDeferAccept in class AbstractEndpoint<NioChannel>public int getKeepAliveCount()
public void bind()
throws Exception
bind in class AbstractEndpoint<NioChannel>Exceptionpublic void startInternal()
throws Exception
startInternal in class AbstractEndpoint<NioChannel>Exceptionpublic void stopInternal()
stopInternal in class AbstractEndpoint<NioChannel>public void unbind()
throws Exception
unbind in class AbstractJsseEndpoint<NioChannel>Exceptionprotected void doCloseServerSocket()
throws IOException
AbstractEndpointdoCloseServerSocket in class AbstractEndpoint<NioChannel>IOException - If an error occurs closing the socketpublic int getWriteBufSize()
public int getReadBufSize()
public NioSelectorPool getSelectorPool()
protected AbstractEndpoint.Acceptor createAcceptor()
AbstractEndpointcreateAcceptor in class AbstractEndpoint<NioChannel>protected CountDownLatch getStopLatch()
protected void setStopLatch(CountDownLatch stopLatch)
protected boolean setSocketOptions(SocketChannel socket)
socket - The socket channeltrue if the socket was correctly configured
and processing may continue, false if the socket needs to be
close immediatelyprotected Log getLog()
getLog in class AbstractEndpoint<NioChannel>protected NetworkChannel getServerSocket()
getServerSocket in class AbstractJsseEndpoint<NioChannel>protected SocketProcessorBase<NioChannel> createSocketProcessor(SocketWrapperBase<NioChannel> socketWrapper, SocketEvent event)
createSocketProcessor in class AbstractEndpoint<NioChannel>Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.