Class AbstractHandlerContainer

All Implemented Interfaces:
Handler, HandlerContainer, Container, Destroyable, Dumpable, Dumpable.DumpableContainer, 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.
  • Field Details

    • LOG

      private static final Logger LOG
  • Constructor Details

    • AbstractHandlerContainer

      public AbstractHandlerContainer()
  • Method Details

    • getChildHandlers

      public Handler[] getChildHandlers()
      Specified by:
      getChildHandlers in interface HandlerContainer
      Returns:
      array of all handlers contained by this handler and it's children
    • getChildHandlersByClass

      public Handler[] getChildHandlersByClass(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(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(List<Handler> list, Class<?> byClass)
    • expandHandler

      protected void expandHandler(Handler handler, List<Handler> list, Class<?> byClass)
    • findContainerOf

      public static <T extends HandlerContainer> T findContainerOf(HandlerContainer root, Class<T> type, Handler handler)
    • setServer

      public void setServer(Server server)
      Specified by:
      setServer in interface Handler
      Overrides:
      setServer in class AbstractHandler
    • doShutdown

      protected void doShutdown(List<Future<Void>> futures) throws 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:
      MultiException