Crossfire JXClient, Trunk
Public Member Functions | Package Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
RequestHandler Class Reference
Inheritance diagram for RequestHandler:
Inheritance graph
Collaboration diagram for RequestHandler:
Collaboration graph

Public Member Functions

void handle (SelectionKey sk) throws IOException
 

Package Functions

 RequestHandler (ChannelIO cio)
 

Private Member Functions

void build () throws IOException
 
boolean parse () throws IOException
 
boolean receive (SelectionKey sk) throws IOException
 
boolean send () throws IOException
 

Private Attributes

ChannelIO cio
 
ByteBuffer rbb = null
 
Reply reply = null
 
Request request = null
 
boolean requestReceived = false
 

Static Private Attributes

static int created = 0
 

Detailed Description

Primary driver class used by non-blocking Servers to receive, prepare, send, and shutdown requests.

Author
Mark Reinhold
Brad R. Wetmore

Definition at line 52 of file RequestHandler.java.

Constructor & Destructor Documentation

◆ RequestHandler()

RequestHandler.RequestHandler ( ChannelIO  cio)
package

Definition at line 63 of file RequestHandler.java.

References cio, and created.

Member Function Documentation

◆ build()

void RequestHandler.build ( ) throws IOException
private

Definition at line 114 of file RequestHandler.java.

References Request.action, Request.Action.GET, Request.Action.HEAD, Reply.Code.METHOD_NOT_ALLOWED, Reply.Code.OK, reply, request, Request.toString(), and Request.uri.

Referenced by handle().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ handle()

void RequestHandler.handle ( SelectionKey  sk) throws IOException

Implements Handler.

Definition at line 125 of file RequestHandler.java.

References build(), cio, ChannelIO.close(), Reply.Code.NOT_FOUND, parse(), Reply.prepare(), rbb, receive(), Reply.release(), reply, request, send(), and ChannelIO.shutdown().

Here is the call graph for this function:

◆ parse()

boolean RequestHandler.parse ( ) throws IOException
private

Definition at line 101 of file RequestHandler.java.

References Reply.Code.BAD_REQUEST, Request.parse(), rbb, reply, and request.

Referenced by handle().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ receive()

boolean RequestHandler.receive ( SelectionKey  sk) throws IOException
private

Definition at line 81 of file RequestHandler.java.

References cio, ChannelIO.doHandshake(), ChannelIO.getReadBuf(), Request.isComplete(), rbb, ChannelIO.read(), and requestReceived.

Referenced by handle().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ send()

boolean RequestHandler.send ( ) throws IOException
private

Definition at line 187 of file RequestHandler.java.

References cio, reply, and Reply.send().

Referenced by handle().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ cio

ChannelIO RequestHandler.cio
private

Definition at line 54 of file RequestHandler.java.

Referenced by handle(), receive(), RequestHandler(), and send().

◆ created

int RequestHandler.created = 0
staticprivate

Definition at line 61 of file RequestHandler.java.

Referenced by RequestHandler().

◆ rbb

ByteBuffer RequestHandler.rbb = null
private

Definition at line 55 of file RequestHandler.java.

Referenced by handle(), parse(), and receive().

◆ reply

Reply RequestHandler.reply = null
private

Definition at line 59 of file RequestHandler.java.

Referenced by build(), handle(), parse(), and send().

◆ request

Request RequestHandler.request = null
private

Definition at line 58 of file RequestHandler.java.

Referenced by build(), handle(), and parse().

◆ requestReceived

boolean RequestHandler.requestReceived = false
private

Definition at line 57 of file RequestHandler.java.

Referenced by receive().


The documentation for this class was generated from the following file: