Class AbstractHandlerContainer

  • All Implemented Interfaces:
    Handler, HandlerContainer, org.eclipse.jetty.util.component.Container, org.eclipse.jetty.util.component.Destroyable, org.eclipse.jetty.util.component.Dumpable, org.eclipse.jetty.util.component.LifeCycle
    Direct Known Subclasses:
    HandlerCollection, HandlerWrapper, HotSwapHandler

    public abstract class AbstractHandlerContainer
    extends AbstractHandler
    implements HandlerContainer
    Abstract Handler Container. This is the base class for handlers that may contain other handlers.
    • Nested Class Summary

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

        org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener, org.eclipse.jetty.util.component.AbstractLifeCycle.StopException
      • 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.LifeCycle

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

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

        FAILED, STARTED, STARTING, STOPPED, STOPPING
      • Fields inherited from interface org.eclipse.jetty.util.component.Dumpable

        KEY
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void doShutdown​(java.util.List<java.util.concurrent.Future<java.lang.Void>> futures)
      Shutdown nested Gracefule handlers
      protected void expandChildren​(java.util.List<Handler> list, java.lang.Class<?> byClass)  
      protected void expandHandler​(Handler handler, java.util.List<Handler> list, java.lang.Class<?> byClass)  
      static <T extends HandlerContainer>
      T
      findContainerOf​(HandlerContainer root, java.lang.Class<T> type, Handler handler)  
      <T extends Handler>
      T
      getChildHandlerByClass​(java.lang.Class<T> byclass)  
      Handler[] getChildHandlers()  
      Handler[] getChildHandlersByClass​(java.lang.Class<?> byclass)  
      void setServer​(Server server)  
      • Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle

        addBean, addBean, addEventListener, addManaged, contains, dump, dump, dump, dumpObjects, dumpStdErr, 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

        getEventListeners, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stop, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface org.eclipse.jetty.util.component.Container

        getCachedBeans, getEventListeners
      • Methods inherited from interface org.eclipse.jetty.util.component.Dumpable

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

        addEventListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeEventListener, start, stop
    • Constructor Detail

      • AbstractHandlerContainer

        public AbstractHandlerContainer()
    • Method Detail

      • getChildHandlersByClass

        public Handler[] getChildHandlersByClass​(java.lang.Class<?> byclass)
        Specified by:
        getChildHandlersByClass in interface HandlerContainer
        Parameters:
        byclass - the child handler class to get
        Returns:
        array of all handlers contained by this handler and it's children of the passed type.
      • getChildHandlerByClass

        public <T extends Handler> T getChildHandlerByClass​(java.lang.Class<T> byclass)
        Specified by:
        getChildHandlerByClass in interface HandlerContainer
        Type Parameters:
        T - the type of handler
        Parameters:
        byclass - the child handler class to get
        Returns:
        first handler of all handlers contained by this handler and it's children of the passed type.
      • expandChildren

        protected void expandChildren​(java.util.List<Handler> list,
                                      java.lang.Class<?> byClass)
      • expandHandler

        protected void expandHandler​(Handler handler,
                                     java.util.List<Handler> list,
                                     java.lang.Class<?> byClass)
      • doShutdown

        protected void doShutdown​(java.util.List<java.util.concurrent.Future<java.lang.Void>> futures)
                           throws org.eclipse.jetty.util.MultiException
        Shutdown nested Gracefule handlers
        Parameters:
        futures - A list of Futures which must also be waited on for the shutdown (or null) returns A MultiException to which any failures are added or null
        Throws:
        org.eclipse.jetty.util.MultiException