Class JerseyHandlerFilter

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

public class JerseyHandlerFilter extends Object implements javax.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 String
     
    static 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​(javax.servlet.ServletRequest servletRequest, javax.servlet.ServletResponse servletResponse, javax.servlet.FilterChain filterChain)
     
    org.glassfish.jersey.server.ApplicationHandler
     
    org.glassfish.jersey.server.ResourceConfig
     
    void
    init​(javax.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(javax.servlet.FilterConfig filterConfig)
      Specified by:
      init in interface javax.servlet.Filter
    • doFilter

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

      public void destroy()
      Specified by:
      destroy in interface javax.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