com.caucho.server.port
Class AbstractServerRequest

java.lang.Object
  extended by com.caucho.server.port.AbstractServerRequest
All Implemented Interfaces:
ServerRequest

public abstract class AbstractServerRequest
extends java.lang.Object
implements ServerRequest

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

ServerRequests are created by Server.createRequest()


Constructor Summary
AbstractServerRequest()
           
 
Method Summary
 void closeEvent()
          Handles a close event when the connection is closed.
abstract  boolean handleRequest()
          Handles a new connection.
 void init()
          Initialize the connection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.caucho.server.port.ServerRequest
handleResume, isWaitForRead, protocolCloseEvent, startConnection
 

Constructor Detail

AbstractServerRequest

public AbstractServerRequest()
Method Detail

init

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

Specified by:
init in interface ServerRequest

handleRequest

public abstract 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.

Specified by:
handleRequest in interface ServerRequest
Parameters:
conn - Information about the connection, including buffered read and write streams.
Throws:
java.io.IOException

closeEvent

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