Interface BlockingHttpService

  • All Superinterfaces:
    java.lang.AutoCloseable, GracefulAutoCloseable
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface BlockingHttpService
    extends GracefulAutoCloseable
    The equivalent of HttpService but with synchronous/blocking APIs instead of asynchronous APIs.
    • Method Detail

      • handle

        HttpResponse handle​(HttpServiceContext ctx,
                            HttpRequest request,
                            HttpResponseFactory responseFactory)
                     throws java.lang.Exception
        Handles a single HTTP request.
        Parameters:
        ctx - Context of the service.
        request - to handle.
        responseFactory - used to create HttpResponse objects.
        Returns:
        Single of HTTP response.
        Throws:
        java.lang.Exception - If an exception occurs during request processing.
      • close

        default void close()
                    throws java.lang.Exception
        Specified by:
        close in interface java.lang.AutoCloseable
        Throws:
        java.lang.Exception