Interface Handler.Collection

All Superinterfaces:
org.eclipse.jetty.util.component.Destroyable, Handler, Handler.Container, org.eclipse.jetty.util.thread.Invocable, org.eclipse.jetty.util.component.LifeCycle, Request.Handler
All Known Implementing Classes:
ContextHandlerCollection, Handler.Sequence
Enclosing interface:
Handler

public static interface Handler.Collection extends Handler.Container

A Handler.Container that can contain multiple other Handlers.

See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.eclipse.jetty.server.Handler

    Handler.Abstract, Handler.AbstractContainer, Handler.Collection, Handler.Container, Handler.Sequence, Handler.Singleton, Handler.Wrapper

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.thread.Invocable

    org.eclipse.jetty.util.thread.Invocable.Callable, org.eclipse.jetty.util.thread.Invocable.InvocationType, org.eclipse.jetty.util.thread.Invocable.ReadyTask, org.eclipse.jetty.util.thread.Invocable.Task

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

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

    Fields inherited from interface org.eclipse.jetty.util.thread.Invocable

    __nonBlocking, NOOP
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Adds the Handler supplied by the given Supplier to this collection of Handlers.
    default void
    Adds the given Handler to this collection of Handlers.
    default boolean
    Removes the given Handler from this collection of Handlers.
    void
    Sets the given Handlers as children of this collection of Handlers.
    default void
    setHandlers(Handler... handlers)
    Similar to setHandlers(List).

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

    destroy

    Methods inherited from interface org.eclipse.jetty.server.Handler

    getServer, setServer

    Methods inherited from interface org.eclipse.jetty.server.Handler.Container

    getContainer, getDescendant, getDescendants, getDescendants, getHandlers

    Methods inherited from interface org.eclipse.jetty.util.thread.Invocable

    getInvocationType

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

    addEventListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeEventListener, start, stop

    Methods inherited from interface org.eclipse.jetty.server.Request.Handler

    handle
  • Method Details

    • addHandler

      default void addHandler(Handler handler)

      Adds the given Handler to this collection of Handlers.

      Parameters:
      handler - the Handler to add
    • removeHandler

      default boolean removeHandler(Handler handler)

      Removes the given Handler from this collection of Handlers.

      Parameters:
      handler - the Handler to remove
      Returns:
      whether the Handler was removed
    • addHandler

      default void addHandler(Supplier<Handler> supplier)

      Adds the Handler supplied by the given Supplier to this collection of Handlers.

      Parameters:
      supplier - the Handler supplier
    • setHandlers

      void setHandlers(List<Handler> handlers)

      Sets the given Handlers as children of this collection of Handlers.

      The list is copied and any subsequent modification to the list does not have any effect on this Handler.

      Any existing children Handler is removed.

      Parameters:
      handlers - the Handler to set as children
    • setHandlers

      default void setHandlers(Handler... handlers)

      Similar to setHandlers(List).

      Parameters:
      handlers - the Handler to set as children