Interface RequestHandler<Req,Resp>

Type Parameters:
Req - тип запроса / request type
Resp - тип ответа / response type
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 RequestHandler<Req,Resp>
High-level handler, который получает уже декодированный запрос и возвращает объект ответа.

High-level handler that receives a decoded request object and returns a response object.

Ядро само занимается encode/decode и отправкой ответа. Если handler возвращает null, ответ не отправляется. Если handler выбрасывает исключение, оно обрабатывается transport-слоем как structured remote error или локальная ошибка, в зависимости от контекста.

The core performs encode/decode and sends the response itself. If the handler returns null, no response is sent. If the handler throws an exception, it is handled by the transport layer as a structured remote error or a local failure depending on context.

  • Method Summary

    Modifier and Type
    Method
    Description
    handle(Req request)
    Обрабатывает запрос и возвращает ответ.
  • Method Details

    • handle

      Resp handle(Req request)
      Обрабатывает запрос и возвращает ответ.

      Handles a request and returns a response.

      Parameters:
      request - объект запроса / request object
      Returns:
      объект ответа или null, если ответ отправлять не нужно / response object or null when no response should be sent