Top Description Inners Fields Constructors Methods
org.apache.tomcat.util.net

public Class Nio2Endpoint

extends AbstractJsseEndpoint<Nio2Channel, AsynchronousSocketChannel>
Class Inheritance
Imports
java.io.EOFException, .File, .IOException, java.net.InetSocketAddress, .SocketAddress, .SocketTimeoutException, java.nio.ByteBuffer, java.nio.channels.AsynchronousChannelGroup, .AsynchronousCloseException, .AsynchronousServerSocketChannel, .AsynchronousSocketChannel, .CompletionHandler, .FileChannel, .NetworkChannel, java.nio.file.StandardOpenOption, java.util.concurrent.ExecutionException, .ExecutorService, .Future, .Semaphore, .TimeUnit, .TimeoutException, javax.net.ssl.SSLEngine, org.apache.juli.logging.Log, .LogFactory, org.apache.tomcat.util.ExceptionUtils, org.apache.tomcat.util.collections.SynchronizedStack, org.apache.tomcat.util.compat.JrePlatform, org.apache.tomcat.util.net.AbstractEndpoint.Handler.SocketState, .Acceptor.AcceptorState, org.apache.tomcat.util.net.jsse.JSSESupport

NIO2 endpoint.

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected class
public static class
public 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.

Field Summary

Modifier and TypeField and Description
private volatile boolean
private static ThreadLocal<Boolean>
inlineCompletion

Allows detecting if a completion handler completes inline.

private static final Log
private static final Log
private static final Log
private SynchronizedStack<Nio2Channel>
nioChannels

Bytebuffer cache, each channel holds a set of buffers (two, except for SSL holds four)

private long
private SocketAddress
private volatile AsynchronousServerSocketChannel
serverSock

Server socket "pointer".

private AsynchronousChannelGroup
threadGroup

Thread group associated with the server socket.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
bind()

Implements abstract org.apache.tomcat.util.net.AbstractEndpoint.bind.

Initialize the endpoint.

protected SocketProcessorBase<Nio2Channel>
protected void
destroySocket(AsynchronousSocketChannel
The newly accepted socket
socket
)

Implements abstract org.apache.tomcat.util.net.AbstractEndpoint.destroySocket.

Close the socket.

protected void
doCloseServerSocket()

Implements abstract org.apache.tomcat.util.net.AbstractEndpoint.doCloseServerSocket.

Actually close the server socket but don't perform any other clean-up.

public static void
public int

Returns:

Always returns -1.
getKeepAliveCount
()

Number of keep-alive sockets.

protected Log
protected Log
protected SynchronizedStack<Nio2Channel>
protected NetworkChannel
public static boolean
public void
resume()

Overrides org.apache.tomcat.util.net.AbstractEndpoint.resume.

Resume the endpoint, which will make it start accepting new connections again.

protected AsynchronousSocketChannel
protected boolean

Returns:

true if the socket was correctly configured and processing may continue, false if the socket needs to be close immediately
setSocketOptions
(AsynchronousSocketChannel
The socket channel
socket
)

Implements abstract org.apache.tomcat.util.net.AbstractEndpoint.setSocketOptions.

Process the specified connection.

public void
protected void
public static void
public void
startInternal()

Implements abstract org.apache.tomcat.util.net.AbstractEndpoint.startInternal.

Start the NIO2 endpoint, creating acceptor.

public void
public void
unbind()

Overrides org.apache.tomcat.util.net.AbstractJsseEndpoint.unbind.

Deallocate NIO memory pools, and close server socket.

Inherited from org.apache.tomcat.util.net.AbstractJsseEndpoint:
createSSLContextcreateSSLEnginegetLocalAddressgetSniParseLimitgetSslImplementationgetSslImplementationNameinitialiseSslsetSniParseLimitsetSslImplementationName