java.lang.Object | |
↳ | org.apache.http.protocol.HttpService |
HttpService is a server side HTTP protocol handler based in the blocking
I/O model that implements the essential requirements of the HTTP protocol
for the server side message processing as described by RFC 2616.
HttpService relies on HttpProcessor
to generate mandatory protocol
headers for all outgoing messages and apply common, cross-cutting message
transformations to all incoming and outgoing messages, whereas individual
HttpRequestHandler
s are expected to take care of application specific
content generation and processing.
HttpService relies on HttpRequestHandler
to resolve matching request
handler for a particular request URI of an incoming HTTP request.
HttpService can use optional HttpExpectationVerifier
to ensure that
incoming requests meet server's expectations.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create a new HTTP service.
| |||||||||||
Create a new HTTP service.
| |||||||||||
This constructor is deprecated.
use
HttpService(HttpProcessor, ConnectionReuseStrategy, HttpResponseFactory, HttpRequestHandlerResolver, HttpParams)
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Handles receives one HTTP request over the given connection within the
given execution context and sends a response back to the client.
| |||||||||||
This method is deprecated.
set
ConnectionReuseStrategy using constructor
| |||||||||||
This method is deprecated.
set
HttpExpectationVerifier using constructor
| |||||||||||
This method is deprecated.
set
HttpRequestHandlerResolver using constructor
| |||||||||||
This method is deprecated.
set
HttpProcessor using constructor
| |||||||||||
This method is deprecated.
set
HttpResponseFactory using constructor
| |||||||||||
This method is deprecated.
set
HttpResponseFactory using constructor
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
The default implementation of this method attempts to resolve an
HttpRequestHandler for the request URI of the given request
and, if found, executes its
handle(HttpRequest, HttpResponse, HttpContext)
method. | |||||||||||
Handles the given exception and generates an HTTP response to be sent
back to the client to inform about the exceptional condition encountered
in the course of the request processing.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Create a new HTTP service.
processor | the processor to use on requests and responses |
---|---|
connStrategy | the connection reuse strategy |
responseFactory | the response factory |
handlerResolver | the handler resolver. May be null. |
expectationVerifier | the expectation verifier. May be null. |
params | the HTTP parameters |
Create a new HTTP service.
processor | the processor to use on requests and responses |
---|---|
connStrategy | the connection reuse strategy |
responseFactory | the response factory |
handlerResolver | the handler resolver. May be null. |
params | the HTTP parameters |
This constructor is deprecated.
use HttpService(HttpProcessor, ConnectionReuseStrategy, HttpResponseFactory, HttpRequestHandlerResolver, HttpParams)
Create a new HTTP service.
proc | the processor to use on requests and responses |
---|---|
connStrategy | the connection reuse strategy |
responseFactory | the response factory |
Handles receives one HTTP request over the given connection within the given execution context and sends a response back to the client.
conn | the active connection to the client |
---|---|
context | the actual execution context. |
IOException | in case of an I/O error. |
---|---|
HttpException | in case of HTTP protocol violation or a processing problem. |
The default implementation of this method attempts to resolve an
HttpRequestHandler
for the request URI of the given request
and, if found, executes its
handle(HttpRequest, HttpResponse, HttpContext)
method.
Super-classes can override this method in order to provide a custom implementation of the request processing logic.
request | the HTTP request. |
---|---|
response | the HTTP response. |
context | the execution context. |
IOException | in case of an I/O error. |
---|---|
HttpException | in case of HTTP protocol violation or a processing problem. |
Handles the given exception and generates an HTTP response to be sent back to the client to inform about the exceptional condition encountered in the course of the request processing.
ex | the exception. |
---|---|
response | the HTTP response. |