|
|||||||||
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
public class AprEndpoint
APR endpoint, 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.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
|
Field Summary | |
---|---|
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 boolean |
deferAccept
Defer accept. |
protected AprEndpoint.Poller |
eventPoller
The socket poller used for event support. |
protected java.util.concurrent.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 java.lang.String |
KEY_SIZE_KEY
The Request attribute key for the key size. |
protected org.apache.tomcat.util.net.AprEndpoint.ListSock[] |
listsock
|
protected static org.jboss.logging.Logger |
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 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. |
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 boolean |
SSLEnabled
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 sendfile 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. |
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()
|
boolean |
getDeferAccept()
|
AprEndpoint.Poller |
getEventPoller()
|
java.util.concurrent.Executor |
getExecutor()
|
AprEndpoint.Handler |
getHandler()
|
int |
getKeepAliveCount()
Number of keepalive sockets. |
int |
getKeepAliveTimeout()
|
int |
getMaxThreads()
|
java.lang.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 |
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 |
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 |
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(java.net.InetAddress address)
|
void |
setBacklog(int backlog)
|
void |
setDaemon(boolean b)
|
void |
setDeferAccept(boolean deferAccept)
|
void |
setExecutor(java.util.concurrent.Executor executor)
|
void |
setHandler(AprEndpoint.Handler handler)
|
void |
setKeepAliveTimeout(int keepAliveTimeout)
|
void |
setMaxThreads(int maxThreads)
|
void |
setName(java.lang.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 |
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 |
setSSLEnabled(boolean SSLEnabled)
|
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 bogus connection. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static org.jboss.logging.Logger 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 java.util.concurrent.Executor executor
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 boolean deferAccept
protected int keepAliveTimeout
protected int pollTime
protected boolean daemon
protected java.lang.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 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 setExecutor(java.util.concurrent.Executor executor)
public java.util.concurrent.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 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 void setDeferAccept(boolean deferAccept)
public boolean getDeferAccept()
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(java.lang.String name)
public java.lang.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 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 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)
protected boolean processSocketWithOptions(long socket)
protected boolean processSocket(long socket)
protected boolean processSocket(long socket, SocketStatus status)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |