HttpService is a server side HTTP protocol handler based on
the classic (blocking) I/O model.
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 HttpRequestHandlers are expected to implement
application specific content generation and processing.
HttpService uses HttpRequestMapper to map
matching request handler for a particular request URI of an incoming HTTP
request.
| Modifier and Type | Class and Description |
|---|---|
| public static class | HttpService.Builder
Builder for |
| Modifier and Type | Field and Description |
|---|---|
| private final ConnectionReuseStrategy | |
| private final HttpProcessor | |
| private final HttpServerRequestHandler | |
| private final Http1StreamListener |
| Access | Constructor and Description |
|---|---|
| public | HttpService(final HttpProcessor
the processor to use on requests and responses processor, final HttpRequestMapper<HttpRequestHandler> the handler mapper handlerMapper, final ConnectionReuseStrategy the connection reuse strategy. If connReuseStrategy, final HttpResponseFactory<ClassicHttpResponse> null
DefaultConnectionReuseStrategy#INSTANCE will be used.the response factory. If responseFactory, final Http1StreamListener null
DefaultClassicHttpResponseFactory#INSTANCE will be used.message stream listener. streamListener)Create a new HTTP service. |
| public | HttpService(final HttpProcessor
the processor to use on requests and responses processor, final HttpRequestMapper<HttpRequestHandler> the handler mapper handlerMapper, final ConnectionReuseStrategy the connection reuse strategy. If connReuseStrategy, final HttpResponseFactory<ClassicHttpResponse> null
DefaultConnectionReuseStrategy#INSTANCE will be used.the response factory. If responseFactory)null
DefaultClassicHttpResponseFactory#INSTANCE will be used.Create a new HTTP service. |
| public | HttpService(final HttpProcessor
the processor to use on requests and responses processor, final HttpServerRequestHandler the request handler. requestHandler, final ConnectionReuseStrategy the connection reuse strategy. If connReuseStrategy, final Http1StreamListener null
DefaultConnectionReuseStrategy#INSTANCE will be used.message stream listener. streamListener)Create a new HTTP service. |
| public | HttpService(final HttpProcessor
the processor to use on requests and responses processor, final HttpServerRequestHandler the request handler. requestHandler)Create a new HTTP service. |
| Modifier and Type | Method and Description |
|---|---|
| public static HttpService. | |
| protected void | handleException(final HttpException
the exception. ex, final ClassicHttpResponse the HTTP response. response)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. |
| public void | handleRequest(final HttpServerConnection
the active connection to the client conn, final HttpContext the actual execution context. context)Handles receives one HTTP request over the given connection within the given execution context and sends a response back to the client. |
| protected int |
| connReuseStrategy | back to summary |
|---|---|
| private final ConnectionReuseStrategy connReuseStrategy | |
| processor | back to summary |
|---|---|
| private final HttpProcessor processor | |
| requestHandler | back to summary |
|---|---|
| private final HttpServerRequestHandler requestHandler | |
| streamListener | back to summary |
|---|---|
| private final Http1StreamListener streamListener | |
| HttpService | back to summary |
|---|---|
| public HttpService(final HttpProcessor processor, final HttpRequestMapper<HttpRequestHandler> handlerMapper, final ConnectionReuseStrategy connReuseStrategy, final HttpResponseFactory<ClassicHttpResponse> responseFactory, final Http1StreamListener streamListener) Create a new HTTP service.
| |
| HttpService | back to summary |
|---|---|
| public HttpService(final HttpProcessor processor, final HttpRequestMapper<HttpRequestHandler> handlerMapper, final ConnectionReuseStrategy connReuseStrategy, final HttpResponseFactory<ClassicHttpResponse> responseFactory) Create a new HTTP service.
| |
| HttpService | back to summary |
|---|---|
| public HttpService(final HttpProcessor processor, final HttpServerRequestHandler requestHandler, final ConnectionReuseStrategy connReuseStrategy, final Http1StreamListener streamListener) Create a new HTTP service.
| |
| HttpService | back to summary |
|---|---|
| public HttpService(final HttpProcessor processor, final HttpServerRequestHandler requestHandler) Create a new HTTP service.
| |
| builder | back to summary |
|---|---|
| public static HttpService. Create a new
| |
| handleException | back to summary |
|---|---|
| protected void handleException(final HttpException ex, final ClassicHttpResponse response) 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.
| |
| handleRequest | back to summary |
|---|---|
| public void handleRequest(final HttpServerConnection conn, final HttpContext context) throws IOException, HttpException Handles receives one HTTP request over the given connection within the given execution context and sends a response back to the client.
| |
| toStatusCode | back to summary |
|---|---|
| protected int toStatusCode(final Exception ex) | |
HttpService.
| Modifier and Type | Field and Description |
|---|---|
| private ConnectionReuseStrategy | |
| private HttpProcessor | |
| private HttpServerRequestHandler | |
| private Http1StreamListener |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public HttpService | |
| public HttpService. | |
| public HttpService. | |
| public HttpService. | |
| public HttpService. |
| connReuseStrategy | back to summary |
|---|---|
| private ConnectionReuseStrategy connReuseStrategy | |
| processor | back to summary |
|---|---|
| private HttpProcessor processor | |
| requestHandler | back to summary |
|---|---|
| private HttpServerRequestHandler requestHandler | |
| streamListener | back to summary |
|---|---|
| private Http1StreamListener streamListener | |
| Builder | back to summary |
|---|---|
| private Builder() | |
| build | back to summary |
|---|---|
| public HttpService build() Create a new HTTP service.
| |
| withConnectionReuseStrategy | back to summary |
|---|---|
| public HttpService. | |
| withHttp1StreamListener | back to summary |
|---|---|
| public HttpService. | |
| withHttpProcessor | back to summary |
|---|---|
| public HttpService. | |
| withHttpServerRequestHandler | back to summary |
|---|---|
| public HttpService. | |