Class DefaultRequestHandler

java.lang.Object
com.soklet.web.request.DefaultRequestHandler
All Implemented Interfaces:
RequestHandler

public class DefaultRequestHandler extends Object implements RequestHandler
Since:
1.0.0
Author:
Mark Allen
  • Constructor Details

  • Method Details

    • handleRequest

      public Optional<Object> handleRequest(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Route route) throws Exception
      Description copied from interface: RequestHandler
      Invokes the resourceMethod associated with the given route.

      Implementors must ensure resourceMethod parameters are appropriately set. For example, a parameter annotated with RequestHeader must have its value set according to the corresponding header in httpServletRequest.

      Specified by:
      handleRequest in interface RequestHandler
      Parameters:
      httpServletRequest - Servlet request
      httpServletResponse - Servlet response
      route - The route to invoke
      Returns:
      The result of the route invocation
      Throws:
      Exception - An exception thrown during route invocation