com.caucho.server.port
Interface ServerRequest

All Known Subinterfaces:
TcpServerRequest
All Known Implementing Classes:
AbstractServerRequest, CompileRequest, HmuxRequest, HttpRequest, SnmpRequest, SocketPolicyRequest, XmppRequest

public interface ServerRequest

Protocol specific information for each request. ServerRequest is reused to reduce memory allocations.

ServerRequests are created by Server.createRequest()


Method Summary
 boolean handleRequest()
          Handles a new connection.
 boolean handleResume()
          Resumes processing after a wair.
 void init()
          Initialize the connection.
 boolean isWaitForRead()
          Return true if the connection should wait for a read before handling the request.
 void protocolCloseEvent()
          Handles a close event when the connection is closed.
 void startConnection()
          Called when the connection starts, i.e.
 

Method Detail

init

void init()
Initialize the connection. At this point, the current thread is the connection thread.


isWaitForRead

boolean isWaitForRead()
Return true if the connection should wait for a read before handling the request.


startConnection

void startConnection()
Called when the connection starts, i.e. just after the accept


handleRequest

boolean handleRequest()
                      throws java.io.IOException
Handles a new connection. The controlling TcpServer may call handleConnection again after the connection completes, so the implementation must initialize any variables for each connection.

Throws:
java.io.IOException

handleResume

boolean handleResume()
                     throws java.io.IOException
Resumes processing after a wair.

Throws:
java.io.IOException

protocolCloseEvent

void protocolCloseEvent()
Handles a close event when the connection is closed.