Class JettyHttpContainer

java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.ContainerLifeCycle
org.eclipse.jetty.server.handler.AbstractHandler
org.glassfish.jersey.jetty.JettyHttpContainer
All Implemented Interfaces:
org.eclipse.jetty.server.Handler, org.eclipse.jetty.util.component.Container, org.eclipse.jetty.util.component.Destroyable, org.eclipse.jetty.util.component.Dumpable, org.eclipse.jetty.util.component.Dumpable.DumpableContainer, org.eclipse.jetty.util.component.LifeCycle, Container

public final class JettyHttpContainer extends org.eclipse.jetty.server.handler.AbstractHandler implements Container
Jersey Container implementation based on Jetty Handler.
Author:
Arul Dhesiaseelan (aruld@acm.org), Libor Kramolis (libor.kramolis at oracle.com), Marek Potociar (marek.potociar at oracle.com)
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.eclipse.jetty.server.handler.AbstractHandler

    org.eclipse.jetty.server.handler.AbstractHandler.ErrorDispatchHandler

    Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

    org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container

    org.eclipse.jetty.util.component.Container.InheritedListener, org.eclipse.jetty.util.component.Container.Listener

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable

    org.eclipse.jetty.util.component.Dumpable.DumpableContainer

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle

    org.eclipse.jetty.util.component.LifeCycle.Listener
  • Field Summary

    Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

    FAILED, RUNNING, STARTED, STARTING, STOPPED, STOPPING

    Fields inherited from interface Container

    DEFAULT_HTTP_PORT, DEFAULT_HTTPS_PORT

    Fields inherited from interface org.eclipse.jetty.util.component.Dumpable

    KEY
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    Inform this container that the server has been started.
    void
    Inform this container that the server is being stopped.
    Get the Jersey server-side application handler associated with the container.
    Return an immutable representation of the current configuration.
    void
    handle(String target, org.eclipse.jetty.server.Request request, javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse)
     
    void
    Reload the hosted Jersey application using the current configuration.
    void
    reload(ResourceConfig configuration)
    Reload the hosted Jersey application using a new configuration.

    Methods inherited from class org.eclipse.jetty.server.handler.AbstractHandler

    destroy, doError, getServer, setServer

    Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle

    addBean, addBean, addEventListener, addManaged, contains, dump, dump, dump, dump, dump, dumpBeans, dumpObject, dumpObjects, dumpStdErr, dumpThis, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, setStopTimeout, start, stop, unmanage, updateBean, updateBean, updateBeans

    Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

    addLifeCycleListener, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop, toString

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.eclipse.jetty.util.component.Dumpable

    dumpSelf

    Methods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer

    isDumpable

    Methods inherited from interface org.eclipse.jetty.util.component.LifeCycle

    addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
  • Method Details

    • handle

      public void handle(String target, org.eclipse.jetty.server.Request request, javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse) throws IOException, javax.servlet.ServletException
      Specified by:
      handle in interface org.eclipse.jetty.server.Handler
      Specified by:
      handle in class org.eclipse.jetty.server.handler.AbstractHandler
      Throws:
      IOException
      javax.servlet.ServletException
    • getConfiguration

      public ResourceConfig getConfiguration()
      Description copied from interface: Container
      Return an immutable representation of the current configuration.
      Specified by:
      getConfiguration in interface Container
      Returns:
      current configuration of the hosted Jersey application.
    • reload

      public void reload()
      Description copied from interface: Container
      Reload the hosted Jersey application using the current configuration.
      Specified by:
      reload in interface Container
    • reload

      public void reload(ResourceConfig configuration)
      Description copied from interface: Container
      Reload the hosted Jersey application using a new configuration.
      Specified by:
      reload in interface Container
      Parameters:
      configuration - new configuration used for the reload.
    • getApplicationHandler

      public ApplicationHandler getApplicationHandler()
      Description copied from interface: Container
      Get the Jersey server-side application handler associated with the container.
      Specified by:
      getApplicationHandler in interface Container
      Returns:
      Jersey server-side application handler associated with the container.
    • doStart

      protected void doStart() throws Exception
      Inform this container that the server has been started. This method must be implicitly called after the server containing this container is started.
      Overrides:
      doStart in class org.eclipse.jetty.server.handler.AbstractHandler
      Throws:
      Exception - if a problem occurred during server startup.
    • doStop

      public void doStop() throws Exception
      Inform this container that the server is being stopped. This method must be implicitly called before the server containing this container is stopped.
      Overrides:
      doStop in class org.eclipse.jetty.server.handler.AbstractHandler
      Throws:
      Exception - if a problem occurred during server shutdown.