Class AppVersionHandlerMap

  • All Implemented Interfaces:
    org.eclipse.jetty.server.Handler, org.eclipse.jetty.server.HandlerContainer, 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

    public class AppVersionHandlerMap
    extends org.eclipse.jetty.server.handler.AbstractHandlerContainer
    AppVersionHandlerMap is a HandlerContainer that identifies each child Handler with a particular AppVersionKey.

    In order to identify which application version each request should be sent to, this class assumes that an attribute will be set on the HttpServletRequest with a value of the AppVersionKey that should be used.

    • 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 org.eclipse.jetty.util.component.Dumpable

        KEY
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addAppVersion​(AppVersion appVersion)  
      void addHandler​(org.eclipse.jetty.server.Handler handler)
      Not supported.
      protected void doStart()  
      protected void doStop()  
      protected void expandChildren​(List<org.eclipse.jetty.server.Handler> list, Class<?> byClass)  
      org.eclipse.jetty.server.Handler getHandler​(AppVersionKey appVersionKey)
      Returns the Handler that will handle requests for the specified application version.
      org.eclipse.jetty.server.Handler[] getHandlers()  
      void handle​(String target, org.eclipse.jetty.server.Request baseRequest, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
      Forward the specified request on to the Handler associated with its application version.
      void removeAppVersion​(AppVersionKey appVersionKey)  
      void removeHandler​(org.eclipse.jetty.server.Handler handler)
      Not supported.
      void setHandlers​(org.eclipse.jetty.server.Handler[] handlers)
      Not supported.
      void setServer​(org.eclipse.jetty.server.Server server)  
      void setSessionStoreFactory​(SessionStoreFactory factory)
      Sets the SessionStoreFactory that will be used for generating the list of SessionStores that will be passed to SessionManager for apps for which sessions are enabled.
      • Methods inherited from class org.eclipse.jetty.server.handler.AbstractHandlerContainer

        doShutdown, expandHandler, findContainerOf, getChildHandlerByClass, getChildHandlers, getChildHandlersByClass
      • Methods inherited from class org.eclipse.jetty.server.handler.AbstractHandler

        destroy, doError, getServer
      • 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 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 Detail

      • addAppVersion

        public void addAppVersion​(AppVersion appVersion)
      • removeAppVersion

        public void removeAppVersion​(AppVersionKey appVersionKey)
      • setSessionStoreFactory

        public void setSessionStoreFactory​(SessionStoreFactory factory)
        Sets the SessionStoreFactory that will be used for generating the list of SessionStores that will be passed to SessionManager for apps for which sessions are enabled. This setter is currently used only for testing purposes. Normally the default factory is sufficient.
      • getHandler

        public org.eclipse.jetty.server.Handler getHandler​(AppVersionKey appVersionKey)
                                                    throws javax.servlet.ServletException
        Returns the Handler that will handle requests for the specified application version.
        Throws:
        javax.servlet.ServletException
      • handle

        public void handle​(String target,
                           org.eclipse.jetty.server.Request baseRequest,
                           javax.servlet.http.HttpServletRequest request,
                           javax.servlet.http.HttpServletResponse response)
                    throws IOException,
                           javax.servlet.ServletException
        Forward the specified request on to the Handler associated with its application version.
        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
      • doStart

        protected void doStart()
                        throws Exception
        Overrides:
        doStart in class org.eclipse.jetty.server.handler.AbstractHandler
        Throws:
        Exception
      • doStop

        protected void doStop()
                       throws Exception
        Overrides:
        doStop in class org.eclipse.jetty.server.handler.AbstractHandler
        Throws:
        Exception
      • setServer

        public void setServer​(org.eclipse.jetty.server.Server server)
        Specified by:
        setServer in interface org.eclipse.jetty.server.Handler
        Overrides:
        setServer in class org.eclipse.jetty.server.handler.AbstractHandlerContainer
      • getHandlers

        public org.eclipse.jetty.server.Handler[] getHandlers()
      • expandChildren

        protected void expandChildren​(List<org.eclipse.jetty.server.Handler> list,
                                      Class<?> byClass)
        Overrides:
        expandChildren in class org.eclipse.jetty.server.handler.AbstractHandlerContainer