public class AprEndpoint extends AbstractEndpoint<java.lang.Long,java.lang.Long> implements SSLContext.SNICallBack
Modifier and Type | Class and Description |
---|---|
static class |
AprEndpoint.AprSocketWrapper |
class |
AprEndpoint.Poller |
class |
AprEndpoint.Sendfile |
static class |
AprEndpoint.SendfileData
SendfileData class.
|
static class |
AprEndpoint.SocketInfo |
static class |
AprEndpoint.SocketList |
protected class |
AprEndpoint.SocketProcessor
This class is the equivalent of the Worker, but will simply use in an
external Executor thread pool.
|
static class |
AprEndpoint.SocketTimeouts |
protected class |
AprEndpoint.SocketWithOptionsProcessor
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 |
---|---|
protected boolean |
deferAccept
Defer accept.
|
protected AprEndpoint.Poller |
poller
The socket poller.
|
protected int |
pollTime
Poll interval, in microseconds.
|
protected long |
rootPool
Root APR memory pool.
|
protected AprEndpoint.Sendfile |
sendfile
The static file sender.
|
protected int |
sendfileSize
Size of the sendfile (= concurrent files which can be served).
|
protected long |
serverSock
Server socket "pointer".
|
protected long |
serverSockPool
APR memory pool for the server socket.
|
protected long |
sslContext
SSL context.
|
acceptors, acceptorThreadCount, acceptorThreadPriority, attributes, internalExecutor, negotiableProtocols, paused, processorCache, running, sm, socketProperties, sslHostConfigs, threadPriority
Constructor and Description |
---|
AprEndpoint() |
Modifier and Type | Method and Description |
---|---|
protected long |
allocatePoller(int size,
long pool,
int timeout)
Allocate a new poller of the specified size.
|
void |
bind()
Initialize the endpoint.
|
protected void |
closeSocket(java.lang.Long socket) |
protected SocketProcessorBase<java.lang.Long> |
createSocketProcessor(SocketWrapperBase<java.lang.Long> socketWrapper,
SocketEvent event) |
protected void |
createSSLContext(SSLHostConfig sslHostConfig)
Create the SSLContextfor the the given SSLHostConfig.
|
protected void |
destroySocket(java.lang.Long socket) |
boolean |
getDeferAccept() |
boolean |
getIpv6v6only() |
int |
getKeepAliveCount()
Obtain the number of kept alive sockets.
|
java.net.InetSocketAddress |
getLocalAddress()
Obtain the network address the server socket is bound to.
|
protected Log |
getLog() |
AprEndpoint.Poller |
getPoller() |
int |
getPollTime() |
AprEndpoint.Sendfile |
getSendfile() |
int |
getSendfileCount()
Obtain the number of sendfile sockets.
|
int |
getSendfileSize() |
protected SSLHostConfig.Type |
getSslConfigType() |
long |
getSslContext(java.lang.String sniHostName)
This callback is made during the TLS handshake when the client uses
the SNI extension to request a specific TLS host.
|
boolean |
isAlpnSupported()
Identifies if the endpoint supports ALPN.
|
protected boolean |
processSocket(long socket,
SocketEvent event)
Process the given socket.
|
protected void |
releaseSSLContext(SSLHostConfig sslHostConfig)
Release the SSLContext, if any, associated with the SSLHostConfig.
|
protected java.lang.Long |
serverSocketAccept() |
void |
setDeferAccept(boolean deferAccept) |
void |
setIpv6v6only(boolean ipv6v6only) |
void |
setMaxConnections(int maxConnections)
This endpoint does not support
-1 for unlimited connections,
nor does it support setting this attribute while the endpoint is running. |
void |
setPollTime(int pollTime) |
void |
setSendfileSize(int sendfileSize) |
protected boolean |
setSocketOptions(java.lang.Long socket)
Process given socket.
|
protected boolean |
setSocketOptions(SocketWrapperBase<java.lang.Long> socketWrapper)
Process the specified connection.
|
void |
setUseSendfile(boolean useSendfile) |
void |
startInternal()
Start the APR endpoint, creating acceptor, poller and sendfile threads.
|
void |
stopInternal()
Stop the endpoint.
|
void |
unbind()
Deallocate APR memory pools, and close server socket.
|
addNegotiatedProtocol, addSslHostConfig, addSslHostConfig, countDownConnection, countUpOrAwaitConnection, createExecutor, destroy, 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, setMaxKeepAliveRequests, setMaxThreads, setMinSpareThreads, setName, setPort, setProperty, setSSLEnabled, setTcpNoDelay, setThreadPriority, shutdownExecutor, start, startAcceptorThreads, stop
protected long rootPool
protected long serverSock
protected long serverSockPool
protected long sslContext
protected boolean deferAccept
protected int sendfileSize
protected int pollTime
protected AprEndpoint.Poller poller
protected AprEndpoint.Sendfile sendfile
public void setDeferAccept(boolean deferAccept)
public boolean getDeferAccept()
getDeferAccept
in class AbstractEndpoint<java.lang.Long,java.lang.Long>
public void setIpv6v6only(boolean ipv6v6only)
public boolean getIpv6v6only()
public void setSendfileSize(int sendfileSize)
public int getSendfileSize()
public int getPollTime()
public void setPollTime(int pollTime)
public void setUseSendfile(boolean useSendfile)
setUseSendfile
in class AbstractEndpoint<java.lang.Long,java.lang.Long>
public AprEndpoint.Poller getPoller()
public AprEndpoint.Sendfile getSendfile()
protected SSLHostConfig.Type getSslConfigType()
getSslConfigType
in class AbstractEndpoint<java.lang.Long,java.lang.Long>
public java.net.InetSocketAddress getLocalAddress() throws java.io.IOException
AbstractEndpoint
getLocalAddress
in class AbstractEndpoint<java.lang.Long,java.lang.Long>
java.io.IOException
- If there is a problem determining the currently bound
socketpublic void setMaxConnections(int maxConnections)
-1
for unlimited connections,
nor does it support setting this attribute while the endpoint is running.
setMaxConnections
in class AbstractEndpoint<java.lang.Long,java.lang.Long>
public int getKeepAliveCount()
public int getSendfileCount()
public void bind() throws java.lang.Exception
bind
in class AbstractEndpoint<java.lang.Long,java.lang.Long>
java.lang.Exception
protected void createSSLContext(SSLHostConfig sslHostConfig) throws java.lang.Exception
AbstractEndpoint
createSSLContext
in class AbstractEndpoint<java.lang.Long,java.lang.Long>
sslHostConfig
- The SSLHostConfig for which the SSLContext should be
createdjava.lang.Exception
- If the SSLContext cannot be created for the given
SSLHostConfigprotected void releaseSSLContext(SSLHostConfig sslHostConfig)
AbstractEndpoint
releaseSSLContext
in class AbstractEndpoint<java.lang.Long,java.lang.Long>
sslHostConfig
- The SSLHostConfig for which the SSLContext should be
releasedpublic long getSslContext(java.lang.String sniHostName)
SSLContext.SNICallBack
getSslContext
in interface SSLContext.SNICallBack
sniHostName
- The host name requested by the clientpublic boolean isAlpnSupported()
AbstractEndpoint
true
implies that AbstractEndpoint.isSSLEnabled()
will also return
true
.isAlpnSupported
in class AbstractEndpoint<java.lang.Long,java.lang.Long>
true
if the endpoint supports ALPN in its current
configuration, otherwise false
.public void startInternal() throws java.lang.Exception
startInternal
in class AbstractEndpoint<java.lang.Long,java.lang.Long>
java.lang.Exception
public void stopInternal()
stopInternal
in class AbstractEndpoint<java.lang.Long,java.lang.Long>
public void unbind() throws java.lang.Exception
unbind
in class AbstractEndpoint<java.lang.Long,java.lang.Long>
java.lang.Exception
protected boolean setSocketOptions(SocketWrapperBase<java.lang.Long> socketWrapper)
socketWrapper
- The socket wrappertrue
if the socket was correctly configured
and processing may continue, false
if the socket needs to be
close immediatelyprotected long allocatePoller(int size, long pool, int timeout)
size
- The sizepool
- The pool from which the poller will be allocatedtimeout
- The timeoutprotected boolean setSocketOptions(java.lang.Long socket)
setSocketOptions
in class AbstractEndpoint<java.lang.Long,java.lang.Long>
socket
- The sockettrue
if the socket was correctly configured
and processing may continue, false
if the socket needs to be
close immediatelyprotected java.lang.Long serverSocketAccept() throws java.lang.Exception
serverSocketAccept
in class AbstractEndpoint<java.lang.Long,java.lang.Long>
java.lang.Exception
protected boolean processSocket(long socket, SocketEvent event)
socket
- The socket to processevent
- The event to processtrue
if the processing completed normally otherwise
false
which indicates an error occurred and that the
socket should be closedprotected SocketProcessorBase<java.lang.Long> createSocketProcessor(SocketWrapperBase<java.lang.Long> socketWrapper, SocketEvent event)
createSocketProcessor
in class AbstractEndpoint<java.lang.Long,java.lang.Long>
protected void closeSocket(java.lang.Long socket)
closeSocket
in class AbstractEndpoint<java.lang.Long,java.lang.Long>
protected void destroySocket(java.lang.Long socket)
destroySocket
in class AbstractEndpoint<java.lang.Long,java.lang.Long>
protected Log getLog()
getLog
in class AbstractEndpoint<java.lang.Long,java.lang.Long>
Copyright © 2000-2022 Apache Software Foundation. All Rights Reserved.