@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.
|
closeGracefullyHttpResponse handle(HttpServiceContext ctx, HttpRequest request, HttpResponseFactory responseFactory) throws java.lang.Exception
ctx - Context of the service.request - to handle.responseFactory - used to create HttpResponse objects.Single of HTTP response.java.lang.Exception - If an exception occurs during request processing.default void close()
throws java.lang.Exception
close in interface java.lang.AutoCloseablejava.lang.Exception