SRJRCFrames
v0.1.296

de.schwarzrot.net.http.server
Class HTTPRequestProcessor

java.lang.Object
  extended by de.schwarzrot.net.http.server.HTTPRequestProcessor
All Implemented Interfaces:
Runnable

public class HTTPRequestProcessor
extends Object
implements Runnable

is used to process HTTP requests. This class does not know anything about the response data. It parses the request and unifies the parameters from GET or POST into a request parameter map. It uses a ProtocolHandler to assemble the response. That protocol handler is defined at service context level.

An instance of this class will be created at each client request. As assembling of response does not change during lifetime of the service, the ProtocolHandler is a static instance, setup once at startup of the service.

Author:
Reinhard Mantey

Field Summary
protected static int bufSize
           
 
Constructor Summary
HTTPRequestProcessor(Socket cs)
          constructor - the HTTPServer implementation creates an instance for each client request.
 
Method Summary
protected  void dumpRequest()
           
protected  void err501(PrintWriter out, String funcName)
           
protected  void parseRequest()
           
 void run()
           
static void setup(HTTPServer<?> srv, ProtocolHandler ph)
          used to setup the ProtocolHandler, which is the same for all instances.
protected  void tellProto()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bufSize

protected static final int bufSize
See Also:
Constant Field Values
Constructor Detail

HTTPRequestProcessor

public HTTPRequestProcessor(Socket cs)
constructor - the HTTPServer implementation creates an instance for each client request.

Parameters:
cs - - the socket to communicate with the client
Method Detail

run

public void run()
Specified by:
run in interface Runnable

dumpRequest

protected void dumpRequest()

err501

protected void err501(PrintWriter out,
                      String funcName)

parseRequest

protected void parseRequest()
                     throws Exception
Throws:
Exception

tellProto

protected void tellProto()
                  throws Exception
Throws:
Exception

setup

public static void setup(HTTPServer<?> srv,
                         ProtocolHandler ph)
used to setup the ProtocolHandler, which is the same for all instances. The ProtocolHandler is configured by the application context.

Parameters:
srv - - the HTTP server engine
ph - - the configured ProtocolHandler

SRJRCFrames
v0.1.296

hosted at
Find SRJRCFrames at SourceForge.net. Fast, secure and free:
           Open Source Software download
Submit a bug or request a feature

SRJRCFrames is published according to the GNU General Public License
Copyright 2005-2012 Reinhard Mantey - some rights reserved.