AbstractUrlHandlerAdapter constructor

AbstractUrlHandlerAdapter(
  1. MethodArgumentResolverManager methodArgumentResolver,
  2. ReturnValueHandlerManager methodReturnValueHandler
)

Creates a new AbstractUrlHandlerAdapter with the provided resolvers.

Parameters

  • methodArgumentResolver: The resolver used to resolve handler arguments.
  • methodReturnValueHandler: The handler used to process return values.

Abstract base implementation of HandlerAdapter for URL-based handler methods.

The AbstractUrlHandlerAdapter provides common invocation logic shared by all concrete handler adapters in the Jetleaf Web framework. It is responsible for managing:

  • Argument resolution for reflective method calls.
  • Handler invocation for DSL-defined routes and annotated controllers.
  • Return value processing via composite return value handlers.

Responsibilities

  • Handle invocation of:
  • Integrate with argument and return value resolver strategies.
  • Allow subclasses to extend behavior for custom handler types.

Lifecycle

Each request execution:

  1. Resolves handler arguments (if applicable).
  2. Invokes the underlying handler function or reflective method.
  3. Delegates the result to the configured return value handler.

Example

final adapter = AnnotatedHandlerAdapter(argResolver, returnHandler);
await adapter.handle(request, response, controllerHandler);

Implementation

AbstractUrlHandlerAdapter(this.methodArgumentResolver, this.methodReturnValueHandler);