| java.lang.Object winstone.ajp13.Ajp13Listener
Ajp13Listener | public class Ajp13Listener implements Listener,Runnable(Code) | | Implements the main listener daemon thread. This is the class that gets
launched by the command line, and owns the server socket, etc.
author: mailto: Rick Knowles version: $Id: Ajp13Listener.java,v 1.12 2006/03/24 17:24:22 rickknowles Exp $ |
Method Summary | |
public void | allocateRequestResponse(Socket socket, InputStream inSocket, OutputStream outSocket, RequestHandlerThread handler, boolean iAmFirst) Called by the request handler thread, because it needs specific setup
code for this connection's protocol (ie construction of request/response
objects, in/out streams, etc). | public void | deallocateRequestResponse(RequestHandlerThread handler, WinstoneRequest req, WinstoneResponse rsp, WinstoneInputStream inData, WinstoneOutputStream outData) Called by the request handler thread, because it needs specific shutdown
code for this connection's protocol (ie releasing input/output streams,
etc). | public void | destroy() Interrupts the listener thread. | public String | parseURI(RequestHandlerThread handler, WinstoneRequest req, WinstoneResponse rsp, WinstoneInputStream inData, Socket socket, boolean iAmFirst) This is kind of a hack, since we have already parsed the uri to get the
input stream. | public boolean | processKeepAlive(WinstoneRequest request, WinstoneResponse response, InputStream inSocket) Tries to wait for extra requests on the same socket. | public void | releaseSocket(Socket socket, InputStream inSocket, OutputStream outSocket) Called by the request handler thread, because it needs specific shutdown
code for this connection's protocol if the keep-alive period expires (ie
closing sockets, etc). | public void | run() The main run method. | public boolean | start() |
allocateRequestResponse | public void allocateRequestResponse(Socket socket, InputStream inSocket, OutputStream outSocket, RequestHandlerThread handler, boolean iAmFirst) throws SocketException, IOException(Code) | | Called by the request handler thread, because it needs specific setup
code for this connection's protocol (ie construction of request/response
objects, in/out streams, etc).
This implementation parses incoming AJP13 packets, and builds an
outputstream that is capable of writing back the response in AJP13
packets.
|
destroy | public void destroy()(Code) | | Interrupts the listener thread. This will trigger a listener shutdown
once the so timeout has passed.
|
processKeepAlive | public boolean processKeepAlive(WinstoneRequest request, WinstoneResponse response, InputStream inSocket) throws IOException, InterruptedException(Code) | | Tries to wait for extra requests on the same socket. If any are found
before the timeout expires, it exits with a true, indicating a new
request is waiting. If the timeout expires, return a false, instructing
the handler thread to begin shutting down the socket and relase itself.
|
releaseSocket | public void releaseSocket(Socket socket, InputStream inSocket, OutputStream outSocket) throws IOException(Code) | | Called by the request handler thread, because it needs specific shutdown
code for this connection's protocol if the keep-alive period expires (ie
closing sockets, etc).
This implementation simply shuts down the socket and streams.
|
run | public void run()(Code) | | The main run method. This handles the normal thread processing.
|
start | public boolean start()(Code) | | |
|
|