Package org.apache.tomcat.util.net
Class AprEndpoint
- java.lang.Object
- 
- org.apache.tomcat.util.net.AbstractEndpoint<java.lang.Long,java.lang.Long>
- 
- org.apache.tomcat.util.net.AprEndpoint
 
 
- 
- All Implemented Interfaces:
- SSLContext.SNICallBack
 
 @Deprecated public class AprEndpoint extends AbstractEndpoint<java.lang.Long,java.lang.Long> implements SSLContext.SNICallBack Deprecated.The APR/Native Connector will be removed in Tomcat 10.1.x onwards.APR tailored thread pool, providing the following services:- Socket acceptor thread
- Socket poller thread
- Sendfile thread
- Worker threads pool
 - Author:
- Mladen Turk, Remy Maucherat
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classAprEndpoint.AprSocketWrapperDeprecated.classAprEndpoint.PollerDeprecated.classAprEndpoint.SendfileDeprecated.static classAprEndpoint.SendfileDataDeprecated.SendfileData class.static classAprEndpoint.SocketInfoDeprecated.static classAprEndpoint.SocketListDeprecated.protected classAprEndpoint.SocketProcessorDeprecated.This class is the equivalent of the Worker, but will simply use in an external Executor thread pool.static classAprEndpoint.SocketTimeoutsDeprecated.protected classAprEndpoint.SocketWithOptionsProcessorDeprecated.This 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 Modifier and Type Field Description protected booleandeferAcceptDeprecated.Defer accept.protected AprEndpoint.PollerpollerDeprecated.The socket poller.protected intpollTimeDeprecated.Poll interval, in microseconds.protected longrootPoolDeprecated.Root APR memory pool.protected AprEndpoint.SendfilesendfileDeprecated.The static file sender.protected intsendfileSizeDeprecated.Size of the sendfile (= concurrent files which can be served).protected longserverSockDeprecated.Server socket "pointer".protected longserverSockPoolDeprecated.APR memory pool for the server socket.protected longsslContextDeprecated.SSL context.- 
Fields inherited from class org.apache.tomcat.util.net.AbstractEndpointacceptor, acceptorThreadCount, acceptorThreadPriority, attributes, connections, internalExecutor, negotiableProtocols, paused, processorCache, running, sm, socketProperties, sslHostConfigs, threadPriority
 
- 
 - 
Constructor SummaryConstructors Constructor Description AprEndpoint()Deprecated.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected longallocatePoller(int size, long pool, int timeout)Deprecated.Allocate a new poller of the specified size.voidbind()Deprecated.Initialize the endpoint.protected SocketProcessorBase<java.lang.Long>createSocketProcessor(SocketWrapperBase<java.lang.Long> socketWrapper, SocketEvent event)Deprecated.protected voidcreateSSLContext(SSLHostConfig sslHostConfig)Deprecated.Create the SSLContext for the given SSLHostConfig.protected voiddestroySocket(java.lang.Long socket)Deprecated.Close the socket.protected voiddoCloseServerSocket()Deprecated.Actually close the server socket but don't perform any other clean-up.booleangetDeferAccept()Deprecated.booleangetIpv6v6only()Deprecated.intgetKeepAliveCount()Deprecated.Obtain the number of kept alive sockets.java.net.InetSocketAddressgetLocalAddress()Deprecated.Obtain the network address the server socket is bound to.protected LoggetLog()Deprecated.AprEndpoint.PollergetPoller()Deprecated.intgetPollTime()Deprecated.AprEndpoint.SendfilegetSendfile()Deprecated.intgetSendfileCount()Deprecated.Obtain the number of sendfile sockets.intgetSendfileSize()Deprecated.longgetSslContext(java.lang.String sniHostName)Deprecated.This callback is made during the TLS handshake when the client uses the SNI extension to request a specific TLS host.booleanisAlpnSupported()Deprecated.Identifies if the endpoint supports ALPN.protected booleanprocessSocket(long socket, SocketEvent event)Deprecated.Process the given socket.protected java.lang.LongserverSocketAccept()Deprecated.voidsetDeferAccept(boolean deferAccept)Deprecated.voidsetIpv6v6only(boolean ipv6v6only)Deprecated.voidsetMaxConnections(int maxConnections)Deprecated.This endpoint does not support-1for unlimited connections, nor does it support setting this attribute while the endpoint is running.voidsetPollTime(int pollTime)Deprecated.voidsetSendfileSize(int sendfileSize)Deprecated.protected booleansetSocketOptions(java.lang.Long socket)Deprecated.Process given socket.protected booleansetSocketOptions(SocketWrapperBase<java.lang.Long> socketWrapper)Deprecated.Process the specified connection.voidsetUseSendfile(boolean useSendfile)Deprecated.voidstartInternal()Deprecated.Start the APR endpoint, creating acceptor, poller and sendfile threads.voidstopInternal()Deprecated.Stop the endpoint.voidunbind()Deprecated.Deallocate APR memory pools, and close server socket.- 
Methods inherited from class org.apache.tomcat.util.net.AbstractEndpointaddNegotiatedProtocol, addSslHostConfig, addSslHostConfig, awaitConnectionsClose, closeServerSocketGraceful, closeSocket, countDownConnection, countUpOrAwaitConnection, createExecutor, destroy, destroySsl, findSslHostConfigs, getAcceptCount, getAcceptorThreadCount, getAcceptorThreadPriority, getAddress, getAttribute, getBacklog, getBindOnInit, getBindState, getConnectionCount, getConnectionLinger, getConnections, getConnectionTimeout, getCurrentThreadCount, getCurrentThreadsBusy, getDaemon, getDefaultSSLHostConfigName, getDomain, getExecutor, getExecutorTerminationTimeoutMillis, getHandler, getKeepAliveTimeout, getLocalPort, getMaxConnections, getMaxHeaderCount, getMaxKeepAliveRequests, getMaxThreads, getMinSpareThreads, getName, getPort, getPortOffset, getPortWithOffset, getProperty, getSocketProperties, getSoLinger, getSoTimeout, getSSLHostConfig, getTcpNoDelay, getThreadPriority, getUseAsyncIO, getUseSendfile, hasNegotiableProtocols, init, 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, setMaxHeaderCount, setMaxKeepAliveRequests, setMaxThreads, setMinSpareThreads, setName, setPort, setPortOffset, setProperty, setSoLinger, setSoTimeout, setSSLEnabled, setTcpNoDelay, setThreadPriority, setUseAsyncIO, shutdownExecutor, start, startAcceptorThread, stop, toTimeout, unlockAccept
 
- 
 
- 
- 
- 
Field Detail- 
rootPoolprotected long rootPool Deprecated.Root APR memory pool.
 - 
serverSockprotected volatile long serverSock Deprecated.Server socket "pointer".
 - 
serverSockPoolprotected long serverSockPool Deprecated.APR memory pool for the server socket.
 - 
sslContextprotected long sslContext Deprecated.SSL context.
 - 
deferAcceptprotected boolean deferAccept Deprecated.Defer accept.
 - 
sendfileSizeprotected int sendfileSize Deprecated.Size of the sendfile (= concurrent files which can be served).
 - 
pollTimeprotected int pollTime Deprecated.Poll interval, in microseconds. The smaller the value, the more CPU the poller will use, but the more responsive to activity it will be.
 - 
pollerprotected AprEndpoint.Poller poller Deprecated.The socket poller.
 - 
sendfileprotected AprEndpoint.Sendfile sendfile Deprecated.The static file sender.
 
- 
 - 
Method Detail- 
setDeferAcceptpublic void setDeferAccept(boolean deferAccept) Deprecated.
 - 
getDeferAcceptpublic boolean getDeferAccept() Deprecated.- Specified by:
- getDeferAcceptin class- AbstractEndpoint<java.lang.Long,java.lang.Long>
 
 - 
setIpv6v6onlypublic void setIpv6v6only(boolean ipv6v6only) Deprecated.
 - 
getIpv6v6onlypublic boolean getIpv6v6only() Deprecated.
 - 
setSendfileSizepublic void setSendfileSize(int sendfileSize) Deprecated.
 - 
getSendfileSizepublic int getSendfileSize() Deprecated.
 - 
getPollTimepublic int getPollTime() Deprecated.
 - 
setPollTimepublic void setPollTime(int pollTime) Deprecated.
 - 
setUseSendfilepublic void setUseSendfile(boolean useSendfile) Deprecated.- Overrides:
- setUseSendfilein class- AbstractEndpoint<java.lang.Long,java.lang.Long>
 
 - 
getPollerpublic AprEndpoint.Poller getPoller() Deprecated.
 - 
getSendfilepublic AprEndpoint.Sendfile getSendfile() Deprecated.
 - 
getLocalAddresspublic java.net.InetSocketAddress getLocalAddress() throws java.io.IOExceptionDeprecated.Description copied from class:AbstractEndpointObtain the network address the server socket is bound to. This primarily exists to enable the correct address to be used when unlocking the server socket since it removes the guess-work involved if no address is specifically set.- Specified by:
- getLocalAddressin class- AbstractEndpoint<java.lang.Long,java.lang.Long>
- Returns:
- The network address that the server socket is listening on or null if the server socket is not currently bound.
- Throws:
- java.io.IOException- If there is a problem determining the currently bound socket
 
 - 
setMaxConnectionspublic void setMaxConnections(int maxConnections) Deprecated.This endpoint does not support-1for unlimited connections, nor does it support setting this attribute while the endpoint is running.- Overrides:
- setMaxConnectionsin class- AbstractEndpoint<java.lang.Long,java.lang.Long>
 
 - 
getKeepAliveCountpublic int getKeepAliveCount() Deprecated.Obtain the number of kept alive sockets.- Returns:
- The number of open sockets currently managed by the Poller
 
 - 
getSendfileCountpublic int getSendfileCount() Deprecated.Obtain the number of sendfile sockets.- Returns:
- The number of sockets currently managed by the Sendfile poller.
 
 - 
bindpublic void bind() throws java.lang.ExceptionDeprecated.Initialize the endpoint.- Specified by:
- bindin class- AbstractEndpoint<java.lang.Long,java.lang.Long>
- Throws:
- java.lang.Exception
 
 - 
createSSLContextprotected void createSSLContext(SSLHostConfig sslHostConfig) throws java.lang.Exception Deprecated.Description copied from class:AbstractEndpointCreate the SSLContext for the given SSLHostConfig.- Specified by:
- createSSLContextin class- AbstractEndpoint<java.lang.Long,java.lang.Long>
- Parameters:
- sslHostConfig- The SSLHostConfig for which the SSLContext should be created
- Throws:
- java.lang.Exception- If the SSLContext cannot be created for the given SSLHostConfig
 
 - 
getSslContextpublic long getSslContext(java.lang.String sniHostName) Deprecated.Description copied from interface:SSLContext.SNICallBackThis callback is made during the TLS handshake when the client uses the SNI extension to request a specific TLS host.- Specified by:
- getSslContextin interface- SSLContext.SNICallBack
- Parameters:
- sniHostName- The host name requested by the client - must be in lower case
- Returns:
- The Java representation of the pointer to the OpenSSL SSLContext to use for the given host or zero if no SSLContext could be identified
 
 - 
isAlpnSupportedpublic boolean isAlpnSupported() Deprecated.Description copied from class:AbstractEndpointIdentifies if the endpoint supports ALPN. Note that a return value oftrueimplies thatAbstractEndpoint.isSSLEnabled()will also returntrue.- Specified by:
- isAlpnSupportedin class- AbstractEndpoint<java.lang.Long,java.lang.Long>
- Returns:
- trueif the endpoint supports ALPN in its current configuration, otherwise- false.
 
 - 
startInternalpublic void startInternal() throws java.lang.ExceptionDeprecated.Start the APR endpoint, creating acceptor, poller and sendfile threads.- Specified by:
- startInternalin class- AbstractEndpoint<java.lang.Long,java.lang.Long>
- Throws:
- java.lang.Exception
 
 - 
stopInternalpublic void stopInternal() Deprecated.Stop the endpoint. This will cause all processing threads to stop.- Specified by:
- stopInternalin class- AbstractEndpoint<java.lang.Long,java.lang.Long>
 
 - 
unbindpublic void unbind() throws java.lang.ExceptionDeprecated.Deallocate APR memory pools, and close server socket.- Specified by:
- unbindin class- AbstractEndpoint<java.lang.Long,java.lang.Long>
- Throws:
- java.lang.Exception
 
 - 
doCloseServerSocketprotected void doCloseServerSocket() Deprecated.Description copied from class:AbstractEndpointActually close the server socket but don't perform any other clean-up.- Specified by:
- doCloseServerSocketin class- AbstractEndpoint<java.lang.Long,java.lang.Long>
 
 - 
setSocketOptionsprotected boolean setSocketOptions(SocketWrapperBase<java.lang.Long> socketWrapper) Deprecated.Process the specified connection.- Parameters:
- socketWrapper- The socket wrapper
- Returns:
- trueif the socket was correctly configured and processing may continue,- falseif the socket needs to be close immediately
 
 - 
allocatePollerprotected long allocatePoller(int size, long pool, int timeout)Deprecated.Allocate a new poller of the specified size.- Parameters:
- size- The size
- pool- The pool from which the poller will be allocated
- timeout- The timeout
- Returns:
- the poller pointer
 
 - 
setSocketOptionsprotected boolean setSocketOptions(java.lang.Long socket) Deprecated.Process given socket. This is called when the socket has been accepted.- Specified by:
- setSocketOptionsin class- AbstractEndpoint<java.lang.Long,java.lang.Long>
- Parameters:
- socket- The socket
- Returns:
- trueif the socket was correctly configured and processing may continue,- falseif the socket needs to be close immediately
 
 - 
serverSocketAcceptprotected java.lang.Long serverSocketAccept() throws java.lang.ExceptionDeprecated.- Specified by:
- serverSocketAcceptin class- AbstractEndpoint<java.lang.Long,java.lang.Long>
- Throws:
- java.lang.Exception
 
 - 
processSocketprotected boolean processSocket(long socket, SocketEvent event)Deprecated.Process the given socket. Typically keep alive or upgraded protocol.- Parameters:
- socket- The socket to process
- event- The event to process
- Returns:
- trueif the processing completed normally otherwise- falsewhich indicates an error occurred and that the socket should be closed
 
 - 
createSocketProcessorprotected SocketProcessorBase<java.lang.Long> createSocketProcessor(SocketWrapperBase<java.lang.Long> socketWrapper, SocketEvent event) Deprecated.- Specified by:
- createSocketProcessorin class- AbstractEndpoint<java.lang.Long,java.lang.Long>
 
 - 
destroySocketprotected void destroySocket(java.lang.Long socket) Deprecated.Description 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<java.lang.Long,java.lang.Long>
- Parameters:
- socket- The newly accepted socket
 
 - 
getLogprotected Log getLog() Deprecated.- Specified by:
- getLogin class- AbstractEndpoint<java.lang.Long,java.lang.Long>
 
 
- 
 
-