de.schwarzrot.net.http.server
Class HTTPRequestProcessor
java.lang.Object
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
bufSize
protected static final int bufSize
- See Also:
- Constant Field Values
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
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 engineph
- - the configured ProtocolHandler
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.