Save This Page
Home » apache-tomcat-6.0.16-src » org.apache » tomcat » util » net » [javadoc | source]
org.apache.tomcat.util.net
public class: AprEndpoint [javadoc | source]
java.lang.Object
   org.apache.tomcat.util.net.AprEndpoint
APR tailored thread pool, providing the following services: When switching to Java 5, there's an opportunity to use the virtual machine's thread pool.
Nested Class Summary:
protected class  AprEndpoint.Acceptor  Server socket acceptor thread. 
public class  AprEndpoint.Poller  Poller class. 
protected class  AprEndpoint.Worker  Server processor class. 
public static class  AprEndpoint.SendfileData  SendfileData class. 
public class  AprEndpoint.Sendfile  Sendfile class. 
public interface  AprEndpoint.Handler  Bare bones interface used for socket processing. Per thread data is to be stored in the ThreadWithAttributes extra folders, or alternately in thread local fields. 
Field Summary
protected static  Log log     
protected static  StringManager sm     
public static final  String CIPHER_SUITE_KEY    The Request attribute key for the cipher suite. 
public static final  String KEY_SIZE_KEY    The Request attribute key for the key size. 
public static final  String CERTIFICATE_KEY    The Request attribute key for the client certificate chain. 
public static final  String SESSION_ID_KEY    The Request attribute key for the session id. This one is a Tomcat extension to the Servlet spec. 
protected final  Object threadSync    Synchronization object. 
protected  Thread acceptorThread    The acceptor thread. 
protected  Thread pollerThread    The socket poller thread. 
protected  Thread sendfileThread    The sendfile thread. 
protected  Stack workers    Available processors. 
protected volatile  boolean running    Running state of the endpoint. 
protected volatile  boolean paused    Will be set to true whenever the endpoint is paused. 
protected  boolean initialized    Track the initialization state of the endpoint. 
protected  int curThreadsBusy    Current worker threads busy count. 
protected  int curThreads    Current worker threads count. 
protected  int sequence    Sequence number used to generate thread names. 
protected  long rootPool    Root APR memory pool. 
protected  long serverSock    Server socket "pointer". 
protected  long serverSockPool    APR memory pool for the server socket. 
protected  long sslContext    SSL context. 
protected  int maxThreads    Maximum amount of worker threads. 
protected  int threadPriority    Priority of the acceptor and poller threads. 
protected  int pollerSize    Size of the socket poller. 
protected  int sendfileSize    Size of the sendfile (= concurrent files which can be served). 
protected  int port    Server socket port. 
protected  InetAddress address    Address for the server socket. 
protected  AprEndpoint.Handler handler    Handling of accepted sockets. 
protected  int backlog    Allows the server developer to specify the backlog that should be used for server sockets. By default, this value is 100. 
protected  boolean tcpNoDelay    Socket TCP no delay. 
protected  int soLinger    Socket linger. 
protected  int soTimeout    Socket timeout. 
protected  int firstReadTimeout    Timeout on first request read before going to the poller, in ms. 
protected  int pollTime    Poll interval, in microseconds. The smaller the value, the more CPU the poller will use, but the more responsive to activity it will be. 
protected  boolean daemon    The default is true - the created threads will be in daemon mode. If set to false, the control thread will not be daemon - and will keep the process alive. 
protected  String name    Name of the thread pool, which will be used for naming child threads. 
protected  boolean useSendfile    Use endfile for sending static files. 
protected  int keepAliveCount    Number of keepalive sockets. 
protected  int sendfileCount    Number of sendfile sockets. 
protected  AprEndpoint.Poller poller    The socket poller. 
protected  AprEndpoint.Sendfile sendfile    The static file sender. 
protected  String SSLEngine    SSL engine. 
protected  String SSLProtocol    SSL protocols. 
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 SSLCipherSuite    SSL cipher suite. 
protected  String SSLCertificateFile    SSL certificate file. 
protected  String SSLCertificateKeyFile    SSL certificate key file. 
protected  String SSLCertificateChainFile    SSL certificate chain file. 
protected  String SSLCACertificatePath    SSL CA certificate path. 
protected  String SSLCACertificateFile    SSL CA certificate file. 
protected  String SSLCARevocationPath    SSL CA revocation path. 
protected  String SSLCARevocationFile    SSL CA revocation file. 
protected  String SSLVerifyClient    SSL verify client. 
protected  int SSLVerifyDepth    SSL verify depth. 
Method from org.apache.tomcat.util.net.AprEndpoint Summary:
createWorkerThread,   destroy,   getAddress,   getBacklog,   getCurrentThreadCount,   getCurrentThreadsBusy,   getDaemon,   getFirstReadTimeout,   getHandler,   getKeepAliveCount,   getMaxSpareThreads,   getMaxThreads,   getMinSpareThreads,   getName,   getPollTime,   getPoller,   getPollerSize,   getPort,   getSSLCACertificateFile,   getSSLCACertificatePath,   getSSLCARevocationFile,   getSSLCARevocationPath,   getSSLCertificateChainFile,   getSSLCertificateFile,   getSSLCertificateKeyFile,   getSSLCipherSuite,   getSSLEngine,   getSSLPassword,   getSSLProtocol,   getSSLVerifyClient,   getSSLVerifyDepth,   getSendfile,   getSendfileCount,   getSendfileSize,   getSequence,   getSoLinger,   getSoTimeout,   getTcpNoDelay,   getThreadPriority,   getUseSendfile,   getWorkerThread,   init,   isPaused,   isRunning,   newWorkerThread,   pause,   recycleWorkerThread,   resume,   setAddress,   setBacklog,   setDaemon,   setFirstReadTimeout,   setHandler,   setMaxThreads,   setName,   setPollTime,   setPollerSize,   setPort,   setSSLCACertificateFile,   setSSLCACertificatePath,   setSSLCARevocationFile,   setSSLCARevocationPath,   setSSLCertificateChainFile,   setSSLCertificateFile,   setSSLCertificateKeyFile,   setSSLCipherSuite,   setSSLEngine,   setSSLPassword,   setSSLProtocol,   setSSLVerifyClient,   setSSLVerifyDepth,   setSendfileSize,   setSoLinger,   setSoTimeout,   setSocketOptions,   setTcpNoDelay,   setThreadPriority,   setUseSendfile,   start,   stop,   unlockAccept
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.tomcat.util.net.AprEndpoint Detail:
 protected AprEndpoint.Worker createWorkerThread() 
    Create (or allocate) and return an available processor for use in processing a specific HTTP request, if possible. If the maximum allowed processors have already been created and are in use, return null instead.
 public  void destroy() throws Exception 
    Deallocate APR memory pools, and close server socket.
 public InetAddress getAddress() 
 public int getBacklog() 
 public int getCurrentThreadCount() 
    Return the amount of threads that are managed by the pool.
 public int getCurrentThreadsBusy() 
    Return the amount of threads currently busy.
 public boolean getDaemon() 
 public int getFirstReadTimeout() 
 public AprEndpoint.Handler getHandler() 
 public int getKeepAliveCount() 
 public int getMaxSpareThreads() 
    Dummy maxSpareThreads property.
 public int getMaxThreads() 
 public int getMinSpareThreads() 
    Dummy minSpareThreads property.
 public String getName() 
 public int getPollTime() 
 public AprEndpoint.Poller getPoller() 
 public int getPollerSize() 
 public int getPort() 
 public String getSSLCACertificateFile() 
 public String getSSLCACertificatePath() 
 public String getSSLCARevocationFile() 
 public String getSSLCARevocationPath() 
 public String getSSLCertificateChainFile() 
 public String getSSLCertificateFile() 
 public String getSSLCertificateKeyFile() 
 public String getSSLCipherSuite() 
 public String getSSLEngine() 
 public String getSSLPassword() 
 public String getSSLProtocol() 
 public String getSSLVerifyClient() 
 public int getSSLVerifyDepth() 
 public AprEndpoint.Sendfile getSendfile() 
 public int getSendfileCount() 
 public int getSendfileSize() 
 protected int getSequence() 
    Get a sequence number used for thread naming.
 public int getSoLinger() 
 public int getSoTimeout() 
 public boolean getTcpNoDelay() 
 public int getThreadPriority() 
 public boolean getUseSendfile() 
 protected AprEndpoint.Worker getWorkerThread() 
    Return a new worker thread, and block while to worker is available.
 public  void init() throws Exception 
    Initialize the endpoint.
 public boolean isPaused() 
    Return the state of the endpoint.
 public 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.
 public  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.
 public  void resume() 
    Resume the endpoint, which will make it start accepting new sockets again.
 public  void setAddress(InetAddress address) 
 public  void setBacklog(int backlog) 
 public  void setDaemon(boolean b) 
 public  void setFirstReadTimeout(int firstReadTimeout) 
 public  void setHandler(AprEndpoint.Handler handler) 
 public  void setMaxThreads(int maxThreads) 
 public  void setName(String name) 
 public  void setPollTime(int pollTime) 
 public  void setPollerSize(int pollerSize) 
 public  void setPort(int port) 
 public  void setSSLCACertificateFile(String SSLCACertificateFile) 
 public  void setSSLCACertificatePath(String SSLCACertificatePath) 
 public  void setSSLCARevocationFile(String SSLCARevocationFile) 
 public  void setSSLCARevocationPath(String SSLCARevocationPath) 
 public  void setSSLCertificateChainFile(String SSLCertificateChainFile) 
 public  void setSSLCertificateFile(String SSLCertificateFile) 
 public  void setSSLCertificateKeyFile(String SSLCertificateKeyFile) 
 public  void setSSLCipherSuite(String SSLCipherSuite) 
 public  void setSSLEngine(String SSLEngine) 
 public  void setSSLPassword(String SSLPassword) 
 public  void setSSLProtocol(String SSLProtocol) 
 public  void setSSLVerifyClient(String SSLVerifyClient) 
 public  void setSSLVerifyDepth(int SSLVerifyDepth) 
 public  void setSendfileSize(int sendfileSize) 
 public  void setSoLinger(int soLinger) 
 public  void setSoTimeout(int soTimeout) 
 protected boolean setSocketOptions(long socket) 
    Process the specified connection.
 public  void setTcpNoDelay(boolean tcpNoDelay) 
 public  void setThreadPriority(int threadPriority) 
 public  void setUseSendfile(boolean useSendfile) 
 public  void start() throws Exception 
    Start the APR endpoint, creating acceptor, poller and sendfile threads.
 public  void stop() 
    Stop the endpoint. This will cause all processing threads to stop.
 protected  void unlockAccept() 
    Unlock the server socket accept using a bugus connection.