|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tomcat.util.net.AprEndpoint
APR tailored thread pool, providing the following services:
Nested Class Summary | |
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.Worker
Server processor class. |
class |
AprEndpoint.WorkerStack
|
Field Summary | |
protected int |
acceptorThreadCount
Acceptor thread count. |
protected java.net.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. |
static java.lang.String |
CERTIFICATE_KEY
The Request attribute key for the client certificate chain. |
static java.lang.String |
CIPHER_SUITE_KEY
The Request attribute key for the cipher suite. |
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 int |
firstReadTimeout
Timeout on first request read before going to the poller, in ms. |
protected AprEndpoint.Handler |
handler
Handling of accepted sockets. |
protected boolean |
initialized
Track the initialization state of the endpoint. |
static java.lang.String |
KEY_SIZE_KEY
The Request attribute key for the key size. |
protected static org.apache.commons.logging.Log |
log
|
protected int |
maxThreads
Maximum amount of worker threads. |
protected java.lang.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 int |
pollerRoundRobin
|
protected AprEndpoint.Poller[] |
pollers
The socket poller. |
protected int |
pollerSize
Size of the socket poller. |
protected int |
pollerThreadCount
Poller thread count. |
protected int |
pollTime
Poll interval, in microseconds. |
protected int |
port
Server socket port. |
protected long |
rootPool
Root APR memory pool. |
protected boolean |
running
Running state of the endpoint. |
protected int |
sendfileRoundRobin
|
protected AprEndpoint.Sendfile[] |
sendfiles
The static file sender. |
protected int |
sendfileSize
Size of the sendfile (= concurrent files which can be served). |
protected int |
sendfileThreadCount
Sendfile thread count. |
protected int |
sequence
Sequence number used to generate thread names. |
protected long |
serverSock
Server socket "pointer". |
protected long |
serverSockPool
APR memory pool for the server socket. |
static java.lang.String |
SESSION_ID_KEY
The Request attribute key for the session id. |
protected static StringManager |
sm
|
protected int |
soLinger
Socket linger. |
protected int |
soTimeout
Socket timeout. |
protected java.lang.String |
SSLCACertificateFile
SSL CA certificate file. |
protected java.lang.String |
SSLCACertificatePath
SSL CA certificate path. |
protected java.lang.String |
SSLCARevocationFile
SSL CA revocation file. |
protected java.lang.String |
SSLCARevocationPath
SSL CA revocation path. |
protected java.lang.String |
SSLCertificateChainFile
SSL certificate chain file. |
protected java.lang.String |
SSLCertificateFile
SSL certificate file. |
protected java.lang.String |
SSLCertificateKeyFile
SSL certificate key file. |
protected java.lang.String |
SSLCipherSuite
SSL cipher suite. |
protected long |
sslContext
SSL context. |
protected java.lang.String |
SSLEngine
SSL engine. |
protected java.lang.String |
SSLPassword
SSL password (if a cert is encrypted, and no password has been provided, a callback will ask for a password). |
protected java.lang.String |
SSLProtocol
SSL protocols. |
protected java.lang.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 endfile for sending static files. |
protected AprEndpoint.WorkerStack |
workers
Available workers. |
Constructor Summary | |
AprEndpoint()
|
Method Summary | |
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. |
int |
getAcceptorThreadCount()
|
java.net.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()
|
int |
getFirstReadTimeout()
|
AprEndpoint.Handler |
getHandler()
|
int |
getKeepAliveCount()
Number of keepalive sockets. |
int |
getMaxHeaderCount()
|
int |
getMaxSpareThreads()
Dummy maxSpareThreads property. |
int |
getMaxThreads()
|
int |
getMinSpareThreads()
Dummy minSpareThreads property. |
java.lang.String |
getName()
|
AprEndpoint.Poller |
getPoller()
|
int |
getPollerSize()
|
int |
getPollerThreadCount()
|
int |
getPollTime()
|
int |
getPort()
|
AprEndpoint.Sendfile |
getSendfile()
|
int |
getSendfileCount()
Number of sendfile sockets. |
int |
getSendfileSize()
|
int |
getSendfileThreadCount()
|
protected int |
getSequence()
Get a sequence number used for thread naming. |
int |
getSoLinger()
|
int |
getSoTimeout()
|
java.lang.String |
getSSLCACertificateFile()
|
java.lang.String |
getSSLCACertificatePath()
|
java.lang.String |
getSSLCARevocationFile()
|
java.lang.String |
getSSLCARevocationPath()
|
java.lang.String |
getSSLCertificateChainFile()
|
java.lang.String |
getSSLCertificateFile()
|
java.lang.String |
getSSLCertificateKeyFile()
|
java.lang.String |
getSSLCipherSuite()
|
java.lang.String |
getSSLEngine()
|
java.lang.String |
getSSLPassword()
|
java.lang.String |
getSSLProtocol()
|
java.lang.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 |
isRunning()
Return the state of the endpoint. |
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 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 |
setAcceptorThreadCount(int acceptorThreadCount)
|
void |
setAddress(java.net.InetAddress address)
|
void |
setBacklog(int backlog)
|
void |
setDaemon(boolean b)
|
void |
setFirstReadTimeout(int firstReadTimeout)
|
void |
setHandler(AprEndpoint.Handler handler)
|
void |
setMaxHeaderCount(int maxHeaderCount)
|
void |
setMaxThreads(int maxThreads)
|
void |
setName(java.lang.String name)
|
void |
setPollerSize(int pollerSize)
|
void |
setPollerThreadCount(int pollerThreadCount)
|
void |
setPollTime(int pollTime)
|
void |
setPort(int port)
|
void |
setSendfileSize(int sendfileSize)
|
void |
setSendfileThreadCount(int sendfileThreadCount)
|
protected boolean |
setSocketOptions(long socket)
Process the specified connection. |
void |
setSoLinger(int soLinger)
|
void |
setSoTimeout(int soTimeout)
|
void |
setSSLCACertificateFile(java.lang.String SSLCACertificateFile)
|
void |
setSSLCACertificatePath(java.lang.String SSLCACertificatePath)
|
void |
setSSLCARevocationFile(java.lang.String SSLCARevocationFile)
|
void |
setSSLCARevocationPath(java.lang.String SSLCARevocationPath)
|
void |
setSSLCertificateChainFile(java.lang.String SSLCertificateChainFile)
|
void |
setSSLCertificateFile(java.lang.String SSLCertificateFile)
|
void |
setSSLCertificateKeyFile(java.lang.String SSLCertificateKeyFile)
|
void |
setSSLCipherSuite(java.lang.String SSLCipherSuite)
|
void |
setSSLEngine(java.lang.String SSLEngine)
|
void |
setSSLPassword(java.lang.String SSLPassword)
|
void |
setSSLProtocol(java.lang.String SSLProtocol)
|
void |
setSSLVerifyClient(java.lang.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()
Unlock the server socket accept using a bugus connection. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static org.apache.commons.logging.Log log
protected static StringManager sm
public static final java.lang.String CIPHER_SUITE_KEY
public static final java.lang.String KEY_SIZE_KEY
public static final java.lang.String CERTIFICATE_KEY
public static final java.lang.String SESSION_ID_KEY
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 int maxThreads
protected int threadPriority
protected int pollerSize
protected int sendfileSize
protected int port
protected java.net.InetAddress address
protected AprEndpoint.Handler handler
protected int backlog
protected boolean tcpNoDelay
protected int soLinger
protected int soTimeout
protected int firstReadTimeout
protected int pollTime
protected boolean daemon
protected java.lang.String name
protected boolean useSendfile
protected int acceptorThreadCount
protected int sendfileThreadCount
protected int pollerThreadCount
protected AprEndpoint.Poller[] pollers
protected int pollerRoundRobin
protected AprEndpoint.Sendfile[] sendfiles
protected int sendfileRoundRobin
protected java.lang.String SSLEngine
protected java.lang.String SSLProtocol
protected java.lang.String SSLPassword
protected java.lang.String SSLCipherSuite
protected java.lang.String SSLCertificateFile
protected java.lang.String SSLCertificateKeyFile
protected java.lang.String SSLCertificateChainFile
protected java.lang.String SSLCACertificatePath
protected java.lang.String SSLCACertificateFile
protected java.lang.String SSLCARevocationPath
protected java.lang.String SSLCARevocationFile
protected java.lang.String SSLVerifyClient
protected int SSLVerifyDepth
Constructor Detail |
public AprEndpoint()
Method Detail |
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 java.net.InetAddress getAddress()
public void setAddress(java.net.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 int getFirstReadTimeout()
public void setFirstReadTimeout(int firstReadTimeout)
public int getPollTime()
public void setPollTime(int pollTime)
public void setDaemon(boolean b)
public boolean getDaemon()
public void setName(java.lang.String name)
public java.lang.String getName()
public void setUseSendfile(boolean useSendfile)
public boolean getUseSendfile()
public void setAcceptorThreadCount(int acceptorThreadCount)
public int getAcceptorThreadCount()
public void setSendfileThreadCount(int sendfileThreadCount)
public int getSendfileThreadCount()
public void setPollerThreadCount(int pollerThreadCount)
public int getPollerThreadCount()
public AprEndpoint.Poller getPoller()
public AprEndpoint.Sendfile getSendfile()
public int getMaxSpareThreads()
public int getMinSpareThreads()
public java.lang.String getSSLEngine()
public void setSSLEngine(java.lang.String SSLEngine)
public java.lang.String getSSLProtocol()
public void setSSLProtocol(java.lang.String SSLProtocol)
public java.lang.String getSSLPassword()
public void setSSLPassword(java.lang.String SSLPassword)
public java.lang.String getSSLCipherSuite()
public void setSSLCipherSuite(java.lang.String SSLCipherSuite)
public java.lang.String getSSLCertificateFile()
public void setSSLCertificateFile(java.lang.String SSLCertificateFile)
public java.lang.String getSSLCertificateKeyFile()
public void setSSLCertificateKeyFile(java.lang.String SSLCertificateKeyFile)
public java.lang.String getSSLCertificateChainFile()
public void setSSLCertificateChainFile(java.lang.String SSLCertificateChainFile)
public java.lang.String getSSLCACertificatePath()
public void setSSLCACertificatePath(java.lang.String SSLCACertificatePath)
public java.lang.String getSSLCACertificateFile()
public void setSSLCACertificateFile(java.lang.String SSLCACertificateFile)
public java.lang.String getSSLCARevocationPath()
public void setSSLCARevocationPath(java.lang.String SSLCARevocationPath)
public java.lang.String getSSLCARevocationFile()
public void setSSLCARevocationFile(java.lang.String SSLCARevocationFile)
public java.lang.String getSSLVerifyClient()
public void setSSLVerifyClient(java.lang.String SSLVerifyClient)
public int getSSLVerifyDepth()
public void setSSLVerifyDepth(int SSLVerifyDepth)
public int getMaxHeaderCount()
public void setMaxHeaderCount(int maxHeaderCount)
public int getKeepAliveCount()
public int getSendfileCount()
public int getCurrentThreadCount()
public int getCurrentThreadsBusy()
public boolean isRunning()
public boolean isPaused()
public void init() throws java.lang.Exception
java.lang.Exception
public void start() throws java.lang.Exception
java.lang.Exception
public void pause()
public void resume()
public void stop()
public void destroy() throws java.lang.Exception
java.lang.Exception
protected int getSequence()
protected void unlockAccept()
protected boolean setSocketOptions(long socket)
protected AprEndpoint.Worker createWorkerThread()
null
instead.
protected AprEndpoint.Worker newWorkerThread()
protected AprEndpoint.Worker getWorkerThread()
protected void recycleWorkerThread(AprEndpoint.Worker workerThread)
workerThread
- The processor to be recycledprotected long allocatePoller(int size, long pool, int timeout)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |