public class ServletConnection extends java.lang.Object implements ThreadPool.InterruptableTask
ServletWebServer's
ThreadPool.Task
for handling a single
servlet connection.Modifier and Type | Field and Description |
---|---|
private HttpServletRequestImpl |
request |
private HttpServletResponseImpl |
response |
private javax.servlet.http.HttpServlet |
servlet |
private boolean |
shuttingDown |
private java.net.Socket |
socket |
Constructor and Description |
---|
ServletConnection(javax.servlet.http.HttpServlet pServlet,
java.net.Socket pSocket)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
run()
Performs the task.
|
void |
shutdown()
Interrupts the task.
|
private final javax.servlet.http.HttpServlet servlet
private final java.net.Socket socket
private final HttpServletRequestImpl request
private final HttpServletResponseImpl response
private boolean shuttingDown
public ServletConnection(javax.servlet.http.HttpServlet pServlet, java.net.Socket pSocket) throws java.io.IOException
pServlet
- The servlet, which ought to handle the request.pSocket
- The socket, to which the client is connected.java.io.IOException
public void run() throws java.lang.Throwable
ThreadPool.Task
run
in interface ThreadPool.Task
java.lang.Throwable
- The task failed, and the worker thread won't be used again.public void shutdown() throws java.lang.Throwable
ThreadPool.InterruptableTask
shutdown
in interface ThreadPool.InterruptableTask
java.lang.Throwable
- Shutting down the task failed.