public class AprEndpoint extends AbstractEndpoint<Long>
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.
|
protected class |
AprEndpoint.AsyncTimeout
Async timeout thread
|
static interface |
AprEndpoint.Handler
Bare bones interface used for socket processing.
|
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
Modifier and Type | Field and Description |
---|---|
protected AprEndpoint.AsyncTimeout |
asyncTimeout
The socket poller.
|
protected boolean |
deferAccept
Defer accept.
|
protected AprEndpoint.Handler |
handler
Handling of accepted sockets.
|
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 int |
sendfileThreadCount
Sendfile thread count.
|
protected long |
serverSock
Server socket "pointer".
|
protected long |
serverSockPool
APR memory pool for the server socket.
|
protected String |
SSLCACertificateFile
SSL CA certificate file.
|
protected String |
SSLCACertificatePath
SSL CA certificate path.
|
protected String |
SSLCARevocationFile
SSL CA revocation file.
|
protected String |
SSLCARevocationPath
SSL CA revocation path.
|
protected String |
SSLCertificateChainFile
SSL certificate chain file.
|
protected String |
SSLCertificateFile
SSL certificate file.
|
protected String |
SSLCertificateKeyFile
SSL certificate key file.
|
protected String |
SSLCipherSuite
SSL cipher suite.
|
protected long |
sslContext
SSL context.
|
protected boolean |
SSLDisableCompression
Disables compression of the SSL stream.
|
protected boolean |
SSLHonorCipherOrder |
protected boolean |
SSLInsecureRenegotiation
SSL allow insecure renegotiation for the the client that does not
support the secure renegotiation.
|
protected String |
SSLPassword
SSL password (if a cert is encrypted, and no password has been provided, a callback
will ask for a password).
|
protected String |
SSLProtocol
SSL protocols.
|
protected String |
SSLVerifyClient
SSL verify client.
|
protected int |
SSLVerifyDepth
SSL verify depth.
|
protected boolean |
useComet
Allow comet request handling.
|
protected boolean |
useSendfile
Use sendfile for sending static files.
|
protected ConcurrentLinkedQueue<SocketWrapper<Long>> |
waitingRequests |
acceptors, acceptorThreadCount, acceptorThreadPriority, attributes, internalExecutor, paused, running, sm, socketProperties, 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.
|
AprEndpoint.AsyncTimeout |
getAsyncTimeout() |
boolean |
getDeferAccept() |
AprEndpoint.Handler |
getHandler() |
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() |
int |
getSendfileThreadCount() |
String |
getSSLCACertificateFile() |
String |
getSSLCACertificatePath() |
String |
getSSLCARevocationFile() |
String |
getSSLCARevocationPath() |
String |
getSSLCertificateChainFile() |
String |
getSSLCertificateFile() |
String |
getSSLCertificateKeyFile() |
String |
getSSLCipherSuite() |
boolean |
getSSLDisableCompression() |
boolean |
getSSLHonorCipherOrder() |
boolean |
getSSLInsecureRenegotiation() |
String |
getSSLPassword() |
String |
getSSLProtocol() |
protected static Set<String> |
getSslProtocolAll() |
String |
getSSLVerifyClient() |
int |
getSSLVerifyDepth() |
boolean |
getUseComet() |
boolean |
getUseCometTimeout() |
boolean |
getUsePolling() |
boolean |
getUseSendfile() |
boolean |
processSocket(long socket,
SocketStatus status)
Process given socket.
|
void |
processSocketAsync(SocketWrapper<Long> socket,
SocketStatus status) |
protected boolean |
processSocketWithOptions(long socket)
Process given socket.
|
void |
removeWaitingRequest(SocketWrapper<Long> socketWrapper) |
void |
setDeferAccept(boolean deferAccept) |
void |
setHandler(AprEndpoint.Handler handler) |
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) |
void |
setSendfileThreadCount(int sendfileThreadCount) |
protected boolean |
setSocketOptions(long socket)
Process the specified connection.
|
void |
setSSLCACertificateFile(String SSLCACertificateFile) |
void |
setSSLCACertificatePath(String SSLCACertificatePath) |
void |
setSSLCARevocationFile(String SSLCARevocationFile) |
void |
setSSLCARevocationPath(String SSLCARevocationPath) |
void |
setSSLCertificateChainFile(String SSLCertificateChainFile) |
void |
setSSLCertificateFile(String SSLCertificateFile) |
void |
setSSLCertificateKeyFile(String SSLCertificateKeyFile) |
void |
setSSLCipherSuite(String SSLCipherSuite) |
void |
setSSLDisableCompression(boolean SSLDisableCompression)
Set to
true to disable SSL compression. |
void |
setSSLHonorCipherOrder(boolean SSLHonorCipherOrder)
Set to
true to enforce the server's cipher order
instead of the default which is to allow the client to choose a
preferred cipher. |
void |
setSSLInsecureRenegotiation(boolean SSLInsecureRenegotiation) |
void |
setSSLPassword(String SSLPassword) |
void |
setSSLProtocol(String SSLProtocol) |
void |
setSSLVerifyClient(String SSLVerifyClient) |
void |
setSSLVerifyDepth(int SSLVerifyDepth) |
void |
setUseComet(boolean useComet) |
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.
|
configureUseServerCipherSuitesOrder, countDownConnection, countUpOrAwaitConnection, createExecutor, destroy, getAcceptorThreadCount, getAcceptorThreadPriority, getAddress, getAlgorithm, getAllowUnsafeLegacyRenegotiation, getAttribute, getBacklog, getBindOnInit, getCiphers, getClientAuth, getConnectionCount, getCrlFile, getCurrentThreadCount, getCurrentThreadsBusy, getDaemon, getExecutor, getExecutorTerminationTimeoutMillis, getKeepAliveTimeout, getKeyAlias, getKeyPass, getKeystoreFile, getKeystorePass, getKeystoreProvider, getKeystoreType, getMaxConnections, getMaxHeaderCount, getMaxKeepAliveRequests, getMaxThreads, getMaxThreadsInternal, getMaxThreadsWithExecutor, getMinSpareThreads, getName, getPort, getProperty, getSessionCacheSize, getSessionTimeout, getSocketProperties, getSoLinger, getSoTimeout, getSslEnabledProtocolsArray, getSslProtocol, getTcpNoDelay, getThreadPriority, getTrustManagerClassName, getTrustMaxCertLength, getTruststoreAlgorithm, getTruststoreFile, getTruststorePass, getTruststoreProvider, getTruststoreType, getUseServerCipherSuitesOrder, handleExceptionWithDelay, init, initializeConnectionLatch, isPaused, isRunning, isSSLEnabled, pause, releaseConnectionLatch, resume, setAcceptorThreadCount, setAcceptorThreadPriority, setAddress, setAlgorithm, setAllowUnsafeLegacyRenegotiation, setAttribute, setBacklog, setBindOnInit, setCiphers, setClientAuth, setCrlFile, setDaemon, setExecutor, setExecutorTerminationTimeoutMillis, setKeepAliveTimeout, setKeyAlias, setKeyPass, setKeystoreFile, setKeystorePass, setKeystoreProvider, setKeystoreType, setMaxHeaderCount, setMaxKeepAliveRequests, setMaxThreads, setMinSpareThreads, setName, setPort, setProperty, setSessionCacheSize, setSessionTimeout, setSoLinger, setSoTimeout, setSSLEnabled, setSslEnabledProtocols, setSslProtocol, setTcpNoDelay, setThreadPriority, setTrustManagerClassName, setTrustMaxCertLength, setTruststoreAlgorithm, setTruststoreFile, setTruststorePass, setTruststoreProvider, setTruststoreType, setUseServerCipherSuitesOrder, shutdownExecutor, start, startAcceptorThreads, stop, unlockAccept
protected long rootPool
protected long serverSock
protected long serverSockPool
protected long sslContext
protected ConcurrentLinkedQueue<SocketWrapper<Long>> waitingRequests
protected boolean deferAccept
protected int sendfileSize
protected AprEndpoint.Handler handler
protected int pollTime
protected boolean useSendfile
protected boolean useComet
protected int sendfileThreadCount
protected AprEndpoint.Poller poller
protected AprEndpoint.AsyncTimeout asyncTimeout
protected AprEndpoint.Sendfile sendfile
protected String SSLProtocol
protected String SSLPassword
protected String SSLCipherSuite
protected String SSLCertificateFile
protected String SSLCertificateKeyFile
protected String SSLCertificateChainFile
protected String SSLCACertificatePath
protected String SSLCACertificateFile
protected String SSLCARevocationPath
protected String SSLCARevocationFile
protected String SSLVerifyClient
protected int SSLVerifyDepth
protected boolean SSLInsecureRenegotiation
protected boolean SSLHonorCipherOrder
protected boolean SSLDisableCompression
public void removeWaitingRequest(SocketWrapper<Long> socketWrapper)
removeWaitingRequest
in class AbstractEndpoint<Long>
public void setDeferAccept(boolean deferAccept)
public boolean getDeferAccept()
getDeferAccept
in class AbstractEndpoint<Long>
public void setSendfileSize(int sendfileSize)
public int getSendfileSize()
public void setHandler(AprEndpoint.Handler handler)
public AprEndpoint.Handler getHandler()
public int getPollTime()
public void setPollTime(int pollTime)
public void setUseSendfile(boolean useSendfile)
public boolean getUseSendfile()
getUseSendfile
in class AbstractEndpoint<Long>
public void setUseComet(boolean useComet)
public boolean getUseComet()
getUseComet
in class AbstractEndpoint<Long>
public boolean getUseCometTimeout()
getUseCometTimeout
in class AbstractEndpoint<Long>
public boolean getUsePolling()
getUsePolling
in class AbstractEndpoint<Long>
public void setSendfileThreadCount(int sendfileThreadCount)
public int getSendfileThreadCount()
public AprEndpoint.Poller getPoller()
public AprEndpoint.AsyncTimeout getAsyncTimeout()
public AprEndpoint.Sendfile getSendfile()
public String getSSLProtocol()
public void setSSLProtocol(String SSLProtocol)
public String getSSLPassword()
public void setSSLPassword(String SSLPassword)
public String getSSLCipherSuite()
public void setSSLCipherSuite(String SSLCipherSuite)
public String getSSLCertificateFile()
public void setSSLCertificateFile(String SSLCertificateFile)
public String getSSLCertificateKeyFile()
public void setSSLCertificateKeyFile(String SSLCertificateKeyFile)
public String getSSLCertificateChainFile()
public void setSSLCertificateChainFile(String SSLCertificateChainFile)
public String getSSLCACertificatePath()
public void setSSLCACertificatePath(String SSLCACertificatePath)
public String getSSLCACertificateFile()
public void setSSLCACertificateFile(String SSLCACertificateFile)
public String getSSLCARevocationPath()
public void setSSLCARevocationPath(String SSLCARevocationPath)
public String getSSLCARevocationFile()
public void setSSLCARevocationFile(String SSLCARevocationFile)
public String getSSLVerifyClient()
public void setSSLVerifyClient(String SSLVerifyClient)
public int getSSLVerifyDepth()
public void setSSLVerifyDepth(int SSLVerifyDepth)
public void setSSLInsecureRenegotiation(boolean SSLInsecureRenegotiation)
public boolean getSSLInsecureRenegotiation()
public void setSSLHonorCipherOrder(boolean SSLHonorCipherOrder)
true
to enforce the server's cipher order
instead of the default which is to allow the client to choose a
preferred cipher.public boolean getSSLHonorCipherOrder()
public void setSSLDisableCompression(boolean SSLDisableCompression)
true
to disable SSL compression. This thwarts CRIME
attack.public boolean getSSLDisableCompression()
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
public 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(long socket)
protected 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 immediatelypublic boolean processSocket(long socket, SocketStatus status)
public void processSocketAsync(SocketWrapper<Long> socket, SocketStatus status)
processSocketAsync
in class AbstractEndpoint<Long>
protected Log getLog()
getLog
in class AbstractEndpoint<Long>
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.