Package org.apache.tomcat.util.net
Class Nio2Endpoint
java.lang.Object
org.apache.tomcat.util.net.AbstractEndpoint<S,U>
 
org.apache.tomcat.util.net.AbstractJsseEndpoint<Nio2Channel,AsynchronousSocketChannel>
 
org.apache.tomcat.util.net.Nio2Endpoint
NIO2 endpoint.
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionprotected classstatic classstatic classSendfileData class.protected classThis class is the equivalent of the Worker, but will simply use in an external Executor thread pool.Nested classes/interfaces inherited from class org.apache.tomcat.util.net.AbstractEndpointAbstractEndpoint.BindState, AbstractEndpoint.Handler<S>
- 
Field SummaryFields inherited from class org.apache.tomcat.util.net.AbstractEndpointacceptor, acceptorThreadPriority, attributes, connections, internalExecutor, negotiableProtocols, paused, processorCache, running, sm, socketProperties, sslHostConfigs, threadPriority
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidbind()Initialize the endpoint.protected SocketProcessorBase<Nio2Channel>createSocketProcessor(SocketWrapperBase<Nio2Channel> socketWrapper, SocketEvent event) protected voidClose the socket.protected voidActually close the server socket but don't perform any other clean-up.static voidintNumber of keep-alive sockets.protected LoggetLog()protected Logprotected SynchronizedStack<Nio2Channel>protected NetworkChannelstatic booleanisInline()voidresume()Resume the endpoint, which will make it start accepting new connections again.protected AsynchronousSocketChannelprotected booleanProcess the specified connection.voidprotected voidstatic voidvoidStart the NIO2 endpoint, creating acceptor.voidStop the endpoint.voidunbind()Deallocate NIO memory pools, and close server socket.Methods inherited from class org.apache.tomcat.util.net.AbstractJsseEndpointcreateSSLContext, createSSLEngine, getLocalAddress, getSniParseLimit, getSslImplementation, getSslImplementationName, initialiseSsl, setSniParseLimit, setSslImplementationNameMethods inherited from class org.apache.tomcat.util.net.AbstractEndpointaddNegotiatedProtocol, addSslHostConfig, addSslHostConfig, awaitConnectionsClose, closeServerSocketGraceful, closeSocket, countDownConnection, countUpOrAwaitConnection, createExecutor, destroy, destroySsl, findSslHostConfigs, generateCertificateDebug, getAcceptCount, getAcceptorThreadPriority, getAddress, getAttribute, getBindOnInit, getBindState, getConnectionCount, getConnectionLinger, getConnections, getConnectionTimeout, getCurrentThreadCount, getCurrentThreadsBusy, getDaemon, getDefaultSSLHostConfigName, getDeferAccept, getDomain, getExecutor, getExecutorTerminationTimeoutMillis, getHandler, getId, getKeepAliveTimeout, getLocalPort, getMaxConnections, getMaxKeepAliveRequests, getMaxThreads, getMinSpareThreads, getName, getPort, getPortOffset, getPortWithOffset, getProperty, getSocketProperties, getSSLHostConfig, getTcpNoDelay, getThreadPriority, getUseAsyncIO, getUseSendfile, getUseVirtualThreads, getUtilityExecutor, hasNegotiableProtocols, init, initializeConnectionLatch, isPaused, isRunning, isSSLEnabled, logCertificate, pause, processSocket, releaseSSLContext, reloadSslHostConfig, reloadSslHostConfigs, removeSslHostConfig, setAcceptCount, setAcceptorThreadPriority, setAddress, setAttribute, setBindOnInit, setConnectionLinger, setConnectionTimeout, setDaemon, setDefaultSSLHostConfigName, setDomain, setExecutor, setExecutorTerminationTimeoutMillis, setHandler, setKeepAliveTimeout, setMaxConnections, setMaxKeepAliveRequests, setMaxThreads, setMinSpareThreads, setName, setPort, setPortOffset, setProperty, setSSLEnabled, setTcpNoDelay, setThreadPriority, setUseAsyncIO, setUseSendfile, setUseVirtualThreads, setUtilityExecutor, start, stop, toTimeout, unlockAccept
- 
Constructor Details- 
Nio2Endpointpublic Nio2Endpoint()
 
- 
- 
Method Details- 
getKeepAliveCountpublic int getKeepAliveCount()Number of keep-alive sockets.- Returns:
- Always returns -1.
 
- 
bindInitialize the endpoint.- Specified by:
- bindin class- AbstractEndpoint<Nio2Channel,- AsynchronousSocketChannel> 
- Throws:
- Exception
 
- 
startInternalStart the NIO2 endpoint, creating acceptor.- Specified by:
- startInternalin class- AbstractEndpoint<Nio2Channel,- AsynchronousSocketChannel> 
- Throws:
- Exception
 
- 
startAcceptorThreadprotected void startAcceptorThread()- Overrides:
- startAcceptorThreadin class- AbstractEndpoint<Nio2Channel,- AsynchronousSocketChannel> 
 
- 
resumepublic void resume()Description copied from class:AbstractEndpointResume the endpoint, which will make it start accepting new connections again.- Overrides:
- resumein class- AbstractEndpoint<Nio2Channel,- AsynchronousSocketChannel> 
 
- 
stopInternalpublic void stopInternal()Stop the endpoint. This will cause all processing threads to stop.- Specified by:
- stopInternalin class- AbstractEndpoint<Nio2Channel,- AsynchronousSocketChannel> 
 
- 
unbindDeallocate NIO memory pools, and close server socket.- Overrides:
- unbindin class- AbstractJsseEndpoint<Nio2Channel,- AsynchronousSocketChannel> 
- Throws:
- Exception
 
- 
doCloseServerSocketDescription copied from class:AbstractEndpointActually close the server socket but don't perform any other clean-up.- Specified by:
- doCloseServerSocketin class- AbstractEndpoint<Nio2Channel,- AsynchronousSocketChannel> 
- Throws:
- IOException- If an error occurs closing the socket
 
- 
shutdownExecutorpublic void shutdownExecutor()- Overrides:
- shutdownExecutorin class- AbstractEndpoint<Nio2Channel,- AsynchronousSocketChannel> 
 
- 
setSocketOptionsProcess the specified connection.- Specified by:
- setSocketOptionsin class- AbstractEndpoint<Nio2Channel,- AsynchronousSocketChannel> 
- Parameters:
- socket- The socket channel
- Returns:
- trueif the socket was correctly configured and processing may continue,- falseif the socket needs to be close immediately
 
- 
destroySocketDescription copied from class:AbstractEndpointClose the socket. This is used when the connector is not in a state which allows processing the socket, or if there was an error which prevented the allocation of the socket wrapper.- Specified by:
- destroySocketin class- AbstractEndpoint<Nio2Channel,- AsynchronousSocketChannel> 
- Parameters:
- socket- The newly accepted socket
 
- 
getNioChannels
- 
getServerSocket- Specified by:
- getServerSocketin class- AbstractJsseEndpoint<Nio2Channel,- AsynchronousSocketChannel> 
 
- 
serverSocketAccept- Specified by:
- serverSocketAcceptin class- AbstractEndpoint<Nio2Channel,- AsynchronousSocketChannel> 
- Throws:
- Exception
 
- 
getLog- Specified by:
- getLogin class- AbstractEndpoint<Nio2Channel,- AsynchronousSocketChannel> 
 
- 
getLogCertificate- Overrides:
- getLogCertificatein class- AbstractEndpoint<Nio2Channel,- AsynchronousSocketChannel> 
 
- 
createSocketProcessorprotected SocketProcessorBase<Nio2Channel> createSocketProcessor(SocketWrapperBase<Nio2Channel> socketWrapper, SocketEvent event) - Specified by:
- createSocketProcessorin class- AbstractEndpoint<Nio2Channel,- AsynchronousSocketChannel> 
 
- 
startInlinepublic static void startInline()
- 
endInlinepublic static void endInline()
- 
isInlinepublic static boolean isInline()
 
-