Class RequestContext

java.lang.Object
com.avoka.fc.core.servlet.RequestContext
Direct Known Subclasses:
MockRequestContext

public class RequestContext extends Object
Provides Servlet API request context object.
  • Constructor Details

    • RequestContext

      public RequestContext(jakarta.servlet.ServletContext context, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response)
      Instantiates a new request context.
      Parameters:
      context - the context
      request - the request
      response - the response
  • Method Details

    • getServletContext

      public jakarta.servlet.ServletContext getServletContext()
      Return the servlet context object.
      Returns:
      the servlet context object
    • getResponse

      public jakarta.servlet.http.HttpServletResponse getResponse()
      Return the servlet response object.
      Returns:
      the servlet response object
    • getRequest

      public jakarta.servlet.http.HttpServletRequest getRequest()
      Return the servlet request object.
      Returns:
      the servlet request object
    • getSession

      public jakarta.servlet.http.HttpSession getSession()
      Return the servlet session object.
      Returns:
      the servlet session object
    • getThreadRequestContext

      public static RequestContext getThreadRequestContext()
      Return the request context object for the current thread.
      Returns:
      the request context object for the current thread
    • getThreadRequest

      public static jakarta.servlet.http.HttpServletRequest getThreadRequest()
      Returns:
      the thread local HtttpServletRequest if defined or null otherwise.
      Since:
      4.3.2
    • bindThreadRequestContext

      public static void bindThreadRequestContext(RequestContext requestContext)
      Bind the request context to the current thread.
      Parameters:
      requestContext - the request context
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Returns:
      the string representation of this object