public class AprEndpoint extends Object
Modifier and Type | Class and Description |
---|---|
protected class |
AprEndpoint.Acceptor
Server socket acceptor thread.
|
static interface |
AprEndpoint.Handler
Bare bones interface used for socket processing.
|
class |
AprEndpoint.Poller
Poller class.
|
class |
AprEndpoint.Sendfile
Sendfile class.
|
static class |
AprEndpoint.SendfileData
SendfileData class.
|
protected class |
AprEndpoint.SocketEventProcessor
This class is the equivalent of the Worker, but will simply use in an
external Executor thread pool.
|
static class |
AprEndpoint.SocketInfo
Socket list class, used to avoid using a possibly large amount of objects
with very little actual use.
|
class |
AprEndpoint.SocketList
Socket list class, used to avoid using a possibly large amount of objects
with very little actual use.
|
protected class |
AprEndpoint.SocketProcessor
This class is the equivalent of the Worker, but will simply use in an
external Executor thread pool.
|
class |
AprEndpoint.SocketTimeouts
Socket list class, used to avoid using a possibly large amount of objects
with very little actual use.
|
protected class |
AprEndpoint.SocketWithOptionsProcessor
This class is the equivalent of the Worker, but will simply use in an
external Executor thread pool.
|
protected class |
AprEndpoint.Worker
Server processor class.
|
class |
AprEndpoint.WorkerStack |
Modifier and Type | Field and Description |
---|---|
protected InetAddress |
address
Address for the server socket.
|
protected int |
backlog
Allows the server developer to specify the backlog that
should be used for server sockets.
|
protected int |
curThreads
Current worker threads count.
|
protected int |
curThreadsBusy
Current worker threads busy count.
|
protected boolean |
daemon
The default is true - the created threads will be
in daemon mode.
|
protected boolean |
deferAccept
Defer accept.
|
protected AprEndpoint.Poller |
eventPoller
The socket poller used for event support.
|
protected Executor |
executor
External Executor based thread pool.
|
protected AprEndpoint.Handler |
handler
Handling of accepted sockets.
|
protected boolean |
initialized
Track the initialization state of the endpoint.
|
protected int |
keepAliveTimeout
Keep-Alive timeout.
|
protected org.apache.tomcat.util.net.AprEndpoint.ListSock[] |
listsock |
protected int |
maxThreads
Maximum amount of worker threads.
|
protected String |
name
Name of the thread pool, which will be used for naming child threads.
|
protected boolean |
paused
Will be set to true whenever the endpoint is paused.
|
protected AprEndpoint.Poller |
poller
The socket poller.
|
protected int |
pollerSize
Size of the socket poller.
|
protected int |
pollTime
Poll interval, in microseconds.
|
protected int |
port
Server socket port.
|
protected boolean |
reverseConnection
Reverse connection.
|
protected long |
rootPool
Root APR memory pool.
|
protected boolean |
running
Running state of the endpoint.
|
protected AprEndpoint.Sendfile |
sendfile
The static file sender.
|
protected int |
sendfileSize
Size of the sendfile (= concurrent files which can be served).
|
protected int |
sequence
Sequence number used to generate thread names.
|
protected long |
serverAddress
The server address.
|
protected int |
serverAddressFamily
The server address family.
|
protected long |
serverSock
Server socket "pointer".
|
protected long |
serverSockPool
APR memory pool for the server socket.
|
protected int |
soLinger
Socket linger.
|
protected int |
soReceiveBuffer
Receive buffer.
|
protected int |
soSendBuffer
Send buffer.
|
protected int |
soTimeout
Socket timeout.
|
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 |
SSLEnabled
SSL engine.
|
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 |
tcpNoDelay
Socket TCP no delay.
|
protected int |
threadPriority
Priority of the acceptor and poller threads.
|
protected boolean |
useSendfile
Use sendfile for sending static files.
|
protected AprEndpoint.WorkerStack |
workers
Available workers.
|
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.
|
protected AprEndpoint.Worker |
createWorkerThread()
Create (or allocate) and return an available processor for use in
processing a specific HTTP request, if possible.
|
void |
destroy()
Deallocate APR memory pools, and close server socket.
|
InetAddress |
getAddress() |
int |
getBacklog() |
int |
getCurrentThreadCount()
Return the amount of threads that are managed by the pool.
|
int |
getCurrentThreadsBusy()
Return the amount of threads currently busy.
|
boolean |
getDaemon() |
boolean |
getDeferAccept() |
AprEndpoint.Poller |
getEventPoller() |
Executor |
getExecutor() |
AprEndpoint.Handler |
getHandler() |
int |
getKeepAliveCount()
Number of keepalive sockets.
|
int |
getKeepAliveTimeout() |
int |
getMaxThreads() |
String |
getName() |
AprEndpoint.Poller |
getPoller() |
int |
getPollerSize() |
int |
getPollTime() |
int |
getPort() |
AprEndpoint.Sendfile |
getSendfile() |
int |
getSendfileCount()
Number of sendfile sockets.
|
int |
getSendfileSize() |
protected int |
getSequence()
Get a sequence number used for thread naming.
|
int |
getSoLinger() |
int |
getSoReceiveBuffer() |
int |
getSoSendBuffer() |
int |
getSoTimeout() |
String |
getSSLCACertificateFile() |
String |
getSSLCACertificatePath() |
String |
getSSLCARevocationFile() |
String |
getSSLCARevocationPath() |
String |
getSSLCertificateChainFile() |
String |
getSSLCertificateFile() |
String |
getSSLCertificateKeyFile() |
String |
getSSLCipherSuite() |
boolean |
getSSLInsecureRenegotiation() |
String |
getSSLPassword() |
String |
getSSLProtocol() |
String |
getSSLVerifyClient() |
int |
getSSLVerifyDepth() |
boolean |
getTcpNoDelay() |
int |
getThreadPriority() |
boolean |
getUseSendfile() |
protected AprEndpoint.Worker |
getWorkerThread()
Return a new worker thread, and block while to worker is available.
|
void |
init()
Initialize the endpoint.
|
boolean |
isPaused()
Return the state of the endpoint.
|
boolean |
isReverseConnection() |
boolean |
isRunning()
Return the state of the endpoint.
|
boolean |
isSSLEnabled() |
protected AprEndpoint.Worker |
newWorkerThread()
Create and return a new processor suitable for processing HTTP
requests and returning the corresponding responses.
|
void |
pause()
Pause the endpoint, which will make it stop accepting new sockets.
|
protected boolean |
processSocket(long socket)
Process given socket.
|
protected boolean |
processSocket(long socket,
SocketStatus status)
Process given socket for an event.
|
protected boolean |
processSocketWithOptions(long socket)
Process given socket.
|
protected void |
recycleWorkerThread(AprEndpoint.Worker workerThread)
Recycle the specified Processor so that it can be used again.
|
void |
resume()
Resume the endpoint, which will make it start accepting new sockets
again.
|
void |
setAddress(InetAddress address) |
void |
setBacklog(int backlog) |
void |
setDaemon(boolean b) |
void |
setDeferAccept(boolean deferAccept) |
void |
setExecutor(Executor executor) |
void |
setHandler(AprEndpoint.Handler handler) |
void |
setKeepAliveTimeout(int keepAliveTimeout) |
void |
setMaxThreads(int maxThreads) |
void |
setName(String name) |
void |
setPollerSize(int pollerSize) |
void |
setPollTime(int pollTime) |
void |
setPort(int port) |
void |
setReverseConnection(boolean reverseConnection) |
void |
setSendfileSize(int sendfileSize) |
protected boolean |
setSocketOptions(long socket)
Process the specified connection.
|
void |
setSoLinger(int soLinger) |
void |
setSoReceiveBuffer(int soReceiveBuffer) |
void |
setSoSendBuffer(int soSendBuffer) |
void |
setSoTimeout(int soTimeout) |
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 |
setSSLEnabled(boolean SSLEnabled) |
void |
setSSLInsecureRenegotiation(boolean SSLInsecureRenegotiation) |
void |
setSSLPassword(String SSLPassword) |
void |
setSSLProtocol(String SSLProtocol) |
void |
setSSLVerifyClient(String SSLVerifyClient) |
void |
setSSLVerifyDepth(int SSLVerifyDepth) |
void |
setTcpNoDelay(boolean tcpNoDelay) |
void |
setThreadPriority(int threadPriority) |
void |
setUseSendfile(boolean useSendfile) |
void |
start()
Start the APR endpoint, creating acceptor, poller and sendfile threads.
|
void |
stop()
Stop the endpoint.
|
protected void |
unlockAccept() |
protected AprEndpoint.WorkerStack workers
protected volatile boolean running
protected volatile boolean paused
protected boolean initialized
protected int curThreadsBusy
protected int curThreads
protected int sequence
protected long rootPool
protected long serverSock
protected long serverSockPool
protected long sslContext
protected Executor executor
protected int maxThreads
protected int threadPriority
protected int pollerSize
protected int sendfileSize
protected int port
protected InetAddress address
protected AprEndpoint.Handler handler
protected int backlog
protected boolean tcpNoDelay
protected int soLinger
protected int soTimeout
protected boolean deferAccept
protected int soReceiveBuffer
protected int soSendBuffer
protected int keepAliveTimeout
protected int pollTime
protected boolean daemon
protected String name
protected boolean useSendfile
protected AprEndpoint.Poller poller
protected AprEndpoint.Poller eventPoller
protected AprEndpoint.Sendfile sendfile
protected long serverAddress
protected int serverAddressFamily
protected boolean reverseConnection
protected org.apache.tomcat.util.net.AprEndpoint.ListSock[] listsock
protected boolean SSLEnabled
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
public void setExecutor(Executor executor)
public Executor getExecutor()
public void setMaxThreads(int maxThreads)
public int getMaxThreads()
public void setThreadPriority(int threadPriority)
public int getThreadPriority()
public void setPollerSize(int pollerSize)
public int getPollerSize()
public void setSendfileSize(int sendfileSize)
public int getSendfileSize()
public int getPort()
public void setPort(int port)
public InetAddress getAddress()
public void setAddress(InetAddress address)
public void setHandler(AprEndpoint.Handler handler)
public AprEndpoint.Handler getHandler()
public void setBacklog(int backlog)
public int getBacklog()
public boolean getTcpNoDelay()
public void setTcpNoDelay(boolean tcpNoDelay)
public int getSoLinger()
public void setSoLinger(int soLinger)
public int getSoTimeout()
public void setSoTimeout(int soTimeout)
public void setDeferAccept(boolean deferAccept)
public boolean getDeferAccept()
public int getSoReceiveBuffer()
public void setSoReceiveBuffer(int soReceiveBuffer)
public int getSoSendBuffer()
public void setSoSendBuffer(int soSendBuffer)
public int getKeepAliveTimeout()
public void setKeepAliveTimeout(int keepAliveTimeout)
public int getPollTime()
public void setPollTime(int pollTime)
public void setDaemon(boolean b)
public boolean getDaemon()
public void setName(String name)
public String getName()
public void setUseSendfile(boolean useSendfile)
public boolean getUseSendfile()
public AprEndpoint.Poller getPoller()
public AprEndpoint.Poller getEventPoller()
public AprEndpoint.Sendfile getSendfile()
public boolean isReverseConnection()
public void setReverseConnection(boolean reverseConnection)
public boolean isSSLEnabled()
public void setSSLEnabled(boolean SSLEnabled)
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 int getKeepAliveCount()
public int getSendfileCount()
public int getCurrentThreadCount()
public int getCurrentThreadsBusy()
public boolean isRunning()
public boolean isPaused()
public void start() throws Exception
Exception
public void pause()
public void resume()
public void stop()
public void destroy() throws Exception
Exception
protected int getSequence()
protected void unlockAccept()
protected boolean setSocketOptions(long socket)
protected AprEndpoint.Worker createWorkerThread()
null
instead.protected AprEndpoint.Worker newWorkerThread()
protected void recycleWorkerThread(AprEndpoint.Worker workerThread)
workerThread
- The processor to be recycledprotected AprEndpoint.Worker getWorkerThread()
protected long allocatePoller(int size, long pool, int timeout)
protected boolean processSocketWithOptions(long socket)
protected boolean processSocket(long socket)
protected boolean processSocket(long socket, SocketStatus status)
Copyright © 2015 JBoss by Red Hat. All rights reserved.