类 HandlerFunctionAdapter

java.lang.Object
cn.taketoday.web.handler.function.support.HandlerFunctionAdapter
所有已实现的接口:
cn.taketoday.core.Ordered, HandlerAdapter

public class HandlerFunctionAdapter extends Object implements HandlerAdapter, cn.taketoday.core.Ordered
HandlerAdapter implementation that supports HandlerFunctions.
从以下版本开始:
4.0
作者:
Arjen Poutsma, Harry Yang
  • 字段详细资料

    • logger

      private static final cn.taketoday.logging.Logger logger
    • order

      private int order
  • 构造器详细资料

    • HandlerFunctionAdapter

      public HandlerFunctionAdapter()
  • 方法详细资料

    • setOrder

      public void setOrder(int order)
      Specify the order value for this HandlerAdapter bean.

      The default value is Ordered.LOWEST_PRECEDENCE, meaning non-ordered.

      另请参阅:
      • Ordered.getOrder()
    • getOrder

      public int getOrder()
      指定者:
      getOrder 在接口中 cn.taketoday.core.Ordered
    • supports

      public boolean supports(Object handler)
      从接口复制的说明: HandlerAdapter
      Given a handler instance, return whether support or not this RequestHandlerAdapter can support it. Typical RequestHandlerAdapters will base the decision on the handler type. RequestHandlerAdapters will usually only support one handler type each.

      A typical implementation:

      return (handler instanceof MyHandler);

      指定者:
      supports 在接口中 HandlerAdapter
      参数:
      handler - handler object to check
      返回:
      whether support or not this object can use the given handler
    • handle

      @Nullable public Object handle(RequestContext context, Object handler) throws Throwable
      从接口复制的说明: HandlerAdapter
      Use the given handler to handle this request. The workflow that is required may vary widely.

      this result will handle by ReturnValueHandler

      指定者:
      handle 在接口中 HandlerAdapter
      参数:
      context - current HTTP request context
      handler - handler to use. This object must have previously been passed to the supports method of this interface, which must have returned true.
      返回:
      an object with the name of the view and the required model data, or null if the request has been handled directly
      抛出:
      Throwable - in case of errors
      另请参阅:
    • handleAsync

      @Nullable private ServerResponse handleAsync(WebAsyncManager asyncManager) throws Throwable
      抛出:
      Throwable