public class AprEndpoint extends AbstractEndpoint<Long> implements SSLContext.SNICallBack
Modifier and Type | Class and Description |
---|---|
protected class |
AprEndpoint.Acceptor
The background thread that listens for incoming TCP/IP connections and
hands them off to an appropriate processor.
|
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 AbstractEndpoint.Acceptor |
createAcceptor()
Hook to allow Endpoints to provide a specific Acceptor implementation.
|
protected SocketProcessorBase<Long> |
createSocketProcessor(SocketWrapperBase<Long> socketWrapper,
SocketEvent event) |
protected void |
createSSLContext(SSLHostConfig sslHostConfig)
Create the SSLContextfor the the given SSLHostConfig.
|
boolean |
getDeferAccept() |
int |
getKeepAliveCount()
Obtain the number of kept alive sockets.
|
int |
getLocalPort()
Port in use.
|
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(String sniHostName)
This callback is made during the TLS handshake when the client uses
the SNI extension to request a specific TLS host.
|
protected boolean |
processSocket(long socket,
SocketEvent event)
Process the given socket.
|
protected boolean |
processSocketWithOptions(long socket)
Process given socket.
|
protected void |
releaseSSLContext(SSLHostConfig sslHostConfig)
Release the SSLContext, if any, associated with the SSLHostConfig.
|
void |
setDeferAccept(boolean deferAccept) |
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(SocketWrapperBase<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, countDownConnection, countUpOrAwaitConnection, createExecutor, destroy, findSslHostConfigs, getAcceptorThreadCount, getAcceptorThreadPriority, getAddress, getAttribute, getBacklog, getBindOnInit, getConnectionCount, getCurrentThreadCount, getCurrentThreadsBusy, getDaemon, getDefaultSSLHostConfigName, getExecutor, getExecutorTerminationTimeoutMillis, getHandler, getKeepAliveTimeout, getMaxConnections, getMaxHeaderCount, getMaxKeepAliveRequests, getMaxThreads, getMaxThreadsExecutor, getMinSpareThreads, getName, getPort, getProperty, getSocketProperties, getSoLinger, getSoTimeout, getSSLHostConfig, getTcpNoDelay, getThreadPriority, getUseSendfile, handleExceptionWithDelay, hasNegotiableProtocols, init, initializeConnectionLatch, isPaused, isRunning, isSSLEnabled, pause, processSocket, releaseConnectionLatch, resume, setAcceptorThreadCount, setAcceptorThreadPriority, setAddress, setAttribute, setBacklog, setBindOnInit, setDaemon, setDefaultSSLHostConfigName, setExecutor, setExecutorTerminationTimeoutMillis, setHandler, setKeepAliveTimeout, setMaxHeaderCount, setMaxKeepAliveRequests, setMaxThreads, setMinSpareThreads, setName, setPort, setProperty, setSoLinger, setSoTimeout, setSSLEnabled, setTcpNoDelay, setThreadPriority, shutdownExecutor, start, startAcceptorThreads, stop, unlockAccept
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<Long>
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<Long>
public AprEndpoint.Poller getPoller()
public AprEndpoint.Sendfile getSendfile()
protected SSLHostConfig.Type getSslConfigType()
getSslConfigType
in class AbstractEndpoint<Long>
public int getLocalPort()
getLocalPort
in class AbstractEndpoint<Long>
public void setMaxConnections(int maxConnections)
-1
for unlimited connections,
nor does it support setting this attribute while the endpoint is running.
setMaxConnections
in class AbstractEndpoint<Long>
public int getKeepAliveCount()
public int getSendfileCount()
public void bind() throws Exception
bind
in class AbstractEndpoint<Long>
Exception
protected void createSSLContext(SSLHostConfig sslHostConfig) throws Exception
AbstractEndpoint
createSSLContext
in class AbstractEndpoint<Long>
sslHostConfig
- The SSLHostConfig for which the SSLContext should be
createdException
- If the SSLContext cannot be created for the given
SSLHostConfigprotected void releaseSSLContext(SSLHostConfig sslHostConfig)
AbstractEndpoint
releaseSSLContext
in class AbstractEndpoint<Long>
sslHostConfig
- The SSLHostConfig for which the SSLContext should be
releasedpublic long getSslContext(String sniHostName)
SSLContext.SNICallBack
getSslContext
in interface SSLContext.SNICallBack
sniHostName
- The host name requested by the clientpublic void startInternal() throws Exception
startInternal
in class AbstractEndpoint<Long>
Exception
public void stopInternal()
stopInternal
in class AbstractEndpoint<Long>
public void unbind() throws Exception
unbind
in class AbstractEndpoint<Long>
Exception
protected AbstractEndpoint.Acceptor createAcceptor()
AbstractEndpoint
createAcceptor
in class AbstractEndpoint<Long>
protected boolean setSocketOptions(SocketWrapperBase<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 processSocketWithOptions(long socket)
socket
- The sockettrue
if the socket was correctly configured
and processing may continue, false
if the socket needs to be
close immediatelyprotected 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<Long> createSocketProcessor(SocketWrapperBase<Long> socketWrapper, SocketEvent event)
createSocketProcessor
in class AbstractEndpoint<Long>
protected Log getLog()
getLog
in class AbstractEndpoint<Long>
Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.