|
Apache Tomcat 7.0.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.tomcat.util.net.AbstractEndpoint
org.apache.tomcat.util.net.JIoEndpoint
public class 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 | |
---|---|
protected class |
JIoEndpoint.Acceptor
Server socket acceptor thread. |
protected class |
JIoEndpoint.AsyncTimeout
Async timeout thread |
static interface |
JIoEndpoint.Handler
Bare bones interface used for socket processing. |
protected class |
JIoEndpoint.SocketProcessor
This class is the equivalent of the Worker, but will simply use in an external Executor thread pool. |
Field Summary | |
---|---|
protected int |
acceptorThreadCount
Acceptor thread count. |
protected JIoEndpoint.Handler |
handler
Handling of accepted sockets. |
protected ServerSocket |
serverSocket
Associated server socket. |
protected ServerSocketFactory |
serverSocketFactory
Server socket factory. |
protected ConcurrentLinkedQueue<SocketWrapper<Socket>> |
waitingRequests
|
Constructor Summary | |
---|---|
JIoEndpoint()
|
Method Summary | |
---|---|
void |
destroy()
Deallocate APR memory pools, and close server socket. |
int |
getAcceptorThreadCount()
|
JIoEndpoint.Handler |
getHandler()
|
ServerSocketFactory |
getServerSocketFactory()
|
void |
init()
|
void |
pause()
|
protected boolean |
processSocket(Socket socket)
Process given socket. |
boolean |
processSocket(SocketWrapper<Socket> socket,
SocketStatus status)
|
void |
resume()
|
void |
setAcceptorThreadCount(int acceptorThreadCount)
|
void |
setHandler(JIoEndpoint.Handler handler)
|
boolean |
setProperty(String name,
String value)
Generic properties - currently only socket.xxx properties |
void |
setServerSocketFactory(ServerSocketFactory factory)
|
protected boolean |
setSocketOptions(Socket socket)
Set the options for the current socket. |
void |
start()
|
void |
stop()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ServerSocket serverSocket
protected int acceptorThreadCount
protected JIoEndpoint.Handler handler
protected ServerSocketFactory serverSocketFactory
protected ConcurrentLinkedQueue<SocketWrapper<Socket>> waitingRequests
Constructor Detail |
---|
public JIoEndpoint()
Method Detail |
---|
public boolean setProperty(String name, String value)
setProperty
in class AbstractEndpoint
public void setAcceptorThreadCount(int acceptorThreadCount)
public int getAcceptorThreadCount()
public void setHandler(JIoEndpoint.Handler handler)
public JIoEndpoint.Handler getHandler()
public void setServerSocketFactory(ServerSocketFactory factory)
public ServerSocketFactory getServerSocketFactory()
public void init() throws Exception
init
in class AbstractEndpoint
Exception
public void start() throws Exception
start
in class AbstractEndpoint
Exception
public void pause()
pause
in class AbstractEndpoint
public void resume()
resume
in class AbstractEndpoint
public void stop()
public void destroy() throws Exception
destroy
in class AbstractEndpoint
Exception
protected boolean setSocketOptions(Socket socket)
protected boolean processSocket(Socket socket)
public boolean processSocket(SocketWrapper<Socket> socket, SocketStatus status)
|
Apache Tomcat 7.0.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |