Save This Page
Home » apache-tomcat-6.0.16-src » org.apache » tomcat » util » net » [javadoc | source]
org.apache.tomcat.util.net
public class: JIoEndpoint [javadoc | source]
java.lang.Object
   org.apache.tomcat.util.net.JIoEndpoint
Handle incoming TCP connections. This class implement a simple server model: one listener thread accepts on a socket and creates a new worker thread for each incoming connection. More advanced Endpoints will reuse the threads, use queues, etc.
Nested Class Summary:
public interface  JIoEndpoint.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. 
protected class  JIoEndpoint.Acceptor  Server socket acceptor thread. 
protected class  JIoEndpoint.SocketProcessor  This class is the equivalent of the Worker, but will simply use in an external Executor thread pool. 
protected class  JIoEndpoint.Worker   
public class  JIoEndpoint.WorkerStack   
Field Summary
protected static  Log log     
protected  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  JIoEndpoint.WorkerStack workers    Available workers. 
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  ServerSocket serverSocket    Associated server socket. 
protected  int acceptorThreadCount    Acceptor thread count. 
protected  Executor executor    External Executor based thread pool. 
protected  int maxThreads    Maximum amount of worker threads. 
protected  int threadPriority    Priority of the acceptor and poller threads. 
protected  int port    Server socket port. 
protected  InetAddress address    Address for the server socket. 
protected  JIoEndpoint.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  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  ServerSocketFactory serverSocketFactory    Server socket factory. 
Method from org.apache.tomcat.util.net.JIoEndpoint Summary:
createWorkerThread,   destroy,   getAcceptorThreadCount,   getAddress,   getBacklog,   getCurrentThreadCount,   getCurrentThreadsBusy,   getDaemon,   getExecutor,   getHandler,   getMaxThreads,   getName,   getPort,   getServerSocketFactory,   getSoLinger,   getSoTimeout,   getTcpNoDelay,   getThreadPriority,   getWorkerThread,   init,   isPaused,   isRunning,   newWorkerThread,   pause,   processSocket,   recycleWorkerThread,   resume,   setAcceptorThreadCount,   setAddress,   setBacklog,   setDaemon,   setExecutor,   setHandler,   setMaxThreads,   setName,   setPort,   setServerSocketFactory,   setSoLinger,   setSoTimeout,   setSocketOptions,   setTcpNoDelay,   setThreadPriority,   start,   stop,   unlockAccept
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.tomcat.util.net.JIoEndpoint Detail:
 protected JIoEndpoint.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 int getAcceptorThreadCount() 
 public InetAddress getAddress() 
 public int getBacklog() 
 public int getCurrentThreadCount() 
 public int getCurrentThreadsBusy() 
 public boolean getDaemon() 
 public Executor getExecutor() 
 public JIoEndpoint.Handler getHandler() 
 public int getMaxThreads() 
 public String getName() 
 public int getPort() 
 public ServerSocketFactory getServerSocketFactory() 
 public int getSoLinger() 
 public int getSoTimeout() 
 public boolean getTcpNoDelay() 
 public int getThreadPriority() 
 protected JIoEndpoint.Worker getWorkerThread() 
    Return a new worker thread, and block while to worker is available.
 public  void init() throws Exception 
 public boolean isPaused() 
 public boolean isRunning() 
 protected JIoEndpoint.Worker newWorkerThread() 
    Create and return a new processor suitable for processing HTTP requests and returning the corresponding responses.
 public  void pause() 
 protected boolean processSocket(Socket socket) 
    Process given socket.
 protected  void recycleWorkerThread(JIoEndpoint.Worker workerThread) 
    Recycle the specified Processor so that it can be used again.
 public  void resume() 
 public  void setAcceptorThreadCount(int acceptorThreadCount) 
 public  void setAddress(InetAddress address) 
 public  void setBacklog(int backlog) 
 public  void setDaemon(boolean b) 
 public  void setExecutor(Executor executor) 
 public  void setHandler(JIoEndpoint.Handler handler) 
 public  void setMaxThreads(int maxThreads) 
 public  void setName(String name) 
 public  void setPort(int port) 
 public  void setServerSocketFactory(ServerSocketFactory factory) 
 public  void setSoLinger(int soLinger) 
 public  void setSoTimeout(int soTimeout) 
 protected boolean setSocketOptions(Socket socket) 
    Set the options for the current socket.
 public  void setTcpNoDelay(boolean tcpNoDelay) 
 public  void setThreadPriority(int threadPriority) 
 public  void start() throws Exception 
 public  void stop() 
 protected  void unlockAccept() 
    Unlock the accept by using a local connection.