@FunctionalInterface
public interface BlockingHttpService
extends GracefulAutoCloseable
HttpService but with synchronous/blocking APIs instead of asynchronous APIs.| Modifier and Type | Method and Description |
|---|---|
default void |
close() |
HttpResponse |
handle(HttpServiceContext ctx,
HttpRequest request,
HttpResponseFactory responseFactory)
Handles a single HTTP request.
|
HttpResponse handle(HttpServiceContext ctx, HttpRequest request, HttpResponseFactory responseFactory) throws Exception
ctx - Context of the service.request - to handle.responseFactory - used to create HttpResponse objects.Single of HTTP response.Exception - If an exception occurs during request processing.default void close()
throws Exception
close in interface AutoCloseableException