org.apache.tomcat.util.net
public class AprEndpoint extends Object
| Nested Class Summary | |
|---|---|
| protected class | AprEndpoint.Acceptor
Server socket acceptor thread. |
| 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. |
| protected class | AprEndpoint.SocketProcessor
This class is the equivalent of the Worker, but will simply use in an
external Executor thread pool. |
| 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 |
| Field Summary | |
|---|---|
| protected int | acceptorThreadCount
Acceptor thread count. |
| 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 | cometPollerRoundRobin |
| protected AprEndpoint.Poller[] | cometPollers
The socket poller used for Comet support. |
| protected int | curThreads
Current worker threads count. |
| protected int | curThreadsBusy
Current worker threads busy count. |
| static String | CERTIFICATE_KEY
The Request attribute key for the client certificate chain. |
| static String | CIPHER_SUITE_KEY
The Request attribute key for the cipher suite. |
| protected boolean | daemon
The default is true - the created threads will be
in daemon mode. |
| protected boolean | deferAccept
Defer accept. |
| 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. |
| static String | KEY_SIZE_KEY
The Request attribute key for the key size. |
| protected static Log | log |
| 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 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. |
| protected static StringManager | sm |
| protected int | soLinger
Socket linger. |
| protected int | soTimeout
Socket timeout. |
| protected long | sslContext
SSL context. |
| static String | SESSION_ID_KEY
The Request attribute key for the session id.
|
| 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 boolean | SSLEnabled
SSL engine. |
| 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 int | unlockTimeout
Unlock timeout. |
| protected boolean | useComet
Allow comet request handling. |
| protected boolean | useSendfile
Use endfile for sending static files. |
| protected AprEndpoint.WorkerStack | workers
Available workers. |
| 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() |
| InetAddress | getAddress() |
| int | getBacklog() |
| AprEndpoint.Poller | getCometPoller() |
| int | getCurrentThreadCount()
Return the amount of threads that are managed by the pool.
|
| int | getCurrentThreadsBusy()
Return the amount of threads that are in use
|
| boolean | getDaemon() |
| boolean | getDeferAccept() |
| Executor | getExecutor() |
| AprEndpoint.Handler | getHandler() |
| int | getKeepAliveCount()
Number of keepalive sockets. |
| int | getKeepAliveTimeout() |
| int | getMaxSpareThreads()
Dummy maxSpareThreads property. |
| int | getMaxThreads() |
| int | getMinSpareThreads()
Dummy minSpareThreads property. |
| 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() |
| String | getSSLCACertificateFile() |
| String | getSSLCACertificatePath() |
| String | getSSLCARevocationFile() |
| String | getSSLCARevocationPath() |
| String | getSSLCertificateChainFile() |
| String | getSSLCertificateFile() |
| String | getSSLCertificateKeyFile() |
| String | getSSLCipherSuite() |
| String | getSSLPassword() |
| String | getSSLProtocol() |
| String | getSSLVerifyClient() |
| int | getSSLVerifyDepth() |
| boolean | getTcpNoDelay() |
| int | getThreadPriority() |
| int | getUnlockTimeout() |
| boolean | getUseComet() |
| 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.
|
| 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 | setAcceptorThreadCount(int acceptorThreadCount) |
| 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 | 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(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 | setSSLPassword(String SSLPassword) |
| void | setSSLProtocol(String SSLProtocol) |
| void | setSSLVerifyClient(String SSLVerifyClient) |
| void | setSSLVerifyDepth(int SSLVerifyDepth) |
| void | setTcpNoDelay(boolean tcpNoDelay) |
| void | setThreadPriority(int threadPriority) |
| void | setUnlockTimeout(int unlockTimeout) |
| void | setUseComet(boolean useComet) |
| 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. |
null instead.Returns: the amount of threads that are managed by the pool
Returns: the amount of threads that are in use
Returns: true if the endpoint is paused, false otherwise
Returns: true if the endpoint is running, false otherwise
Parameters: workerThread The processor to be recycled