| winstone.Listener
All known Subclasses: winstone.ajp13.Ajp13Listener, winstone.HttpListener,
Listener | public interface Listener (Code) | | Interface that defines the necessary methods for being a connection listener
within winstone.
author: Rick Knowles |
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) | 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 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). The iAmFirst variable identifies whether or
not this is the initial request on on this socket (ie a keep alive or
a first-time accept)
|
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).
|
start | public boolean start()(Code) | | After the listener is loaded and initialized, this starts the thread
|
|
|