Class JerseyHandlerFilter

java.lang.Object
com.amazonaws.serverless.proxy.jersey.JerseyHandlerFilter
All Implemented Interfaces:
jakarta.servlet.Filter, org.glassfish.jersey.server.spi.Container

public class JerseyHandlerFilter extends Object implements jakarta.servlet.Filter, org.glassfish.jersey.server.spi.Container
Servlet filter class that calls Jersey's ApplicationHandler. Given a Jax RS Application object, this class initializes a Jersey ApplicationHandler and calls its handle method. Requests are transformed to ContainerRequest objects by the servletRequestToContainerRequest(ServletRequest) method. Jersey responses are written directly to the ServletResponse by the JerseyServletResponseWriter.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     

    Fields inherited from interface org.glassfish.jersey.server.spi.Container

    DEFAULT_HTTP_PORT, DEFAULT_HTTPS_PORT
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    void
    doFilter(jakarta.servlet.ServletRequest servletRequest, jakarta.servlet.ServletResponse servletResponse, jakarta.servlet.FilterChain filterChain)
     
    org.glassfish.jersey.server.ApplicationHandler
     
    org.glassfish.jersey.server.ResourceConfig
     
    void
    init(jakarta.servlet.FilterConfig filterConfig)
     
    void
    Shuts down and restarts the application handler in the current container.
    void
    reload(org.glassfish.jersey.server.ResourceConfig resourceConfig)
    Restarts the application handler and configures a different Application object.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Method Details

    • init

      public void init(jakarta.servlet.FilterConfig filterConfig)
      Specified by:
      init in interface jakarta.servlet.Filter
    • doFilter

      public void doFilter(jakarta.servlet.ServletRequest servletRequest, jakarta.servlet.ServletResponse servletResponse, jakarta.servlet.FilterChain filterChain) throws IOException, jakarta.servlet.ServletException
      Specified by:
      doFilter in interface jakarta.servlet.Filter
      Throws:
      IOException
      jakarta.servlet.ServletException
    • destroy

      public void destroy()
      Specified by:
      destroy in interface jakarta.servlet.Filter
    • getConfiguration

      public org.glassfish.jersey.server.ResourceConfig getConfiguration()
      Specified by:
      getConfiguration in interface org.glassfish.jersey.server.spi.Container
    • getApplicationHandler

      public org.glassfish.jersey.server.ApplicationHandler getApplicationHandler()
      Specified by:
      getApplicationHandler in interface org.glassfish.jersey.server.spi.Container
    • reload

      public void reload()
      Shuts down and restarts the application handler in the current container. The ApplicationHandler object is re-initialized with the Application object initially set in the LambdaContainer.getInstance() call.
      Specified by:
      reload in interface org.glassfish.jersey.server.spi.Container
    • reload

      public void reload(org.glassfish.jersey.server.ResourceConfig resourceConfig)
      Restarts the application handler and configures a different Application object. The new application resets the one currently configured in the container.
      Specified by:
      reload in interface org.glassfish.jersey.server.spi.Container
      Parameters:
      resourceConfig - An initialized Application