public class NioEndpoint extends AbstractJsseEndpoint<NioChannel,java.nio.channels.SocketChannel>
| Modifier and Type | Class and Description |
|---|---|
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 void |
closeSocket(java.nio.channels.SocketChannel socket) |
protected SocketProcessorBase<NioChannel> |
createSocketProcessor(SocketWrapperBase<NioChannel> socketWrapper,
SocketEvent event) |
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() |
NioSelectorPool |
getSelectorPool() |
long |
getSelectorTimeout() |
protected java.nio.channels.NetworkChannel |
getServerSocket() |
protected java.util.concurrent.CountDownLatch |
getStopLatch() |
protected void |
initServerSocket() |
protected java.nio.channels.SocketChannel |
serverSocketAccept() |
void |
setPollerThreadCount(int pollerThreadCount) |
void |
setPollerThreadPriority(int pollerThreadPriority) |
boolean |
setProperty(java.lang.String name,
java.lang.String value)
Generic properties, introspected
|
void |
setSelectorPool(NioSelectorPool selectorPool) |
void |
setSelectorTimeout(long timeout) |
protected boolean |
setSocketOptions(java.nio.channels.SocketChannel socket)
Process the specified connection.
|
protected void |
setStopLatch(java.util.concurrent.CountDownLatch stopLatch) |
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, destroySsl, getLocalAddress, getSniParseLimit, getSslConfigType, getSslImplementation, getSslImplementationName, initialiseSsl, isAlpnSupported, releaseSSLContext, setSniParseLimit, setSslImplementationNameaddNegotiatedProtocol, addSslHostConfig, addSslHostConfig, countDownConnection, countUpOrAwaitConnection, createExecutor, destroy, destroySocket, findSslHostConfigs, getAcceptCount, getAcceptorThreadCount, getAcceptorThreadPriority, getAddress, getAttribute, getBindOnInit, getConnectionCount, getConnectionLinger, getConnectionTimeout, getCurrentThreadCount, getCurrentThreadsBusy, getDaemon, getDefaultSSLHostConfigName, getDomain, getExecutor, getExecutorTerminationTimeoutMillis, getHandler, getKeepAliveTimeout, getLocalPort, getMaxConnections, getMaxKeepAliveRequests, getMaxThreads, getMinSpareThreads, getName, getPort, getProperty, getSocketProperties, getSSLHostConfig, getTcpNoDelay, getThreadPriority, getUseSendfile, hasNegotiableProtocols, init, initializeConnectionLatch, isPaused, isRunning, isSSLEnabled, pause, processSocket, reloadSslHostConfig, reloadSslHostConfigs, removeSslHostConfig, resume, setAcceptCount, setAcceptorThreadCount, setAcceptorThreadPriority, setAddress, setAttribute, setBindOnInit, setConnectionLinger, setConnectionTimeout, setDaemon, setDefaultSSLHostConfigName, setDomain, setExecutor, setExecutorTerminationTimeoutMillis, setHandler, setKeepAliveTimeout, setMaxConnections, setMaxKeepAliveRequests, setMaxThreads, setMinSpareThreads, setName, setPort, setSSLEnabled, setTcpNoDelay, setThreadPriority, setUseSendfile, shutdownExecutor, start, startAcceptorThreads, stoppublic static final int OP_REGISTER
public boolean setProperty(java.lang.String name,
java.lang.String value)
setProperty in class AbstractEndpoint<NioChannel,java.nio.channels.SocketChannel>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 boolean getDeferAccept()
getDeferAccept in class AbstractEndpoint<NioChannel,java.nio.channels.SocketChannel>public int getKeepAliveCount()
public void bind()
throws java.lang.Exception
bind in class AbstractEndpoint<NioChannel,java.nio.channels.SocketChannel>java.lang.Exceptionprotected void initServerSocket()
throws java.lang.Exception
java.lang.Exceptionpublic void startInternal()
throws java.lang.Exception
startInternal in class AbstractEndpoint<NioChannel,java.nio.channels.SocketChannel>java.lang.Exceptionpublic void stopInternal()
stopInternal in class AbstractEndpoint<NioChannel,java.nio.channels.SocketChannel>public void unbind()
throws java.lang.Exception
unbind in class AbstractJsseEndpoint<NioChannel,java.nio.channels.SocketChannel>java.lang.Exceptionpublic NioSelectorPool getSelectorPool()
protected java.util.concurrent.CountDownLatch getStopLatch()
protected void setStopLatch(java.util.concurrent.CountDownLatch stopLatch)
protected boolean setSocketOptions(java.nio.channels.SocketChannel socket)
setSocketOptions in class AbstractEndpoint<NioChannel,java.nio.channels.SocketChannel>socket - The socket channeltrue if the socket was correctly configured
and processing may continue, false if the socket needs to be
close immediatelyprotected void closeSocket(java.nio.channels.SocketChannel socket)
closeSocket in class AbstractEndpoint<NioChannel,java.nio.channels.SocketChannel>protected java.nio.channels.NetworkChannel getServerSocket()
getServerSocket in class AbstractJsseEndpoint<NioChannel,java.nio.channels.SocketChannel>protected java.nio.channels.SocketChannel serverSocketAccept()
throws java.lang.Exception
serverSocketAccept in class AbstractEndpoint<NioChannel,java.nio.channels.SocketChannel>java.lang.Exceptionprotected Log getLog()
getLog in class AbstractEndpoint<NioChannel,java.nio.channels.SocketChannel>protected SocketProcessorBase<NioChannel> createSocketProcessor(SocketWrapperBase<NioChannel> socketWrapper, SocketEvent event)
createSocketProcessor in class AbstractEndpoint<NioChannel,java.nio.channels.SocketChannel>Copyright © 2000-1969 Apache Software Foundation. All Rights Reserved.