Class SessionContainer

All Implemented Interfaces:
EventListener, Connection.Listener, Dumpable, Graceful, LifeCycle
Direct Known Subclasses:
AbstractHTTP2ServerConnectionFactory.HTTP2SessionContainer

@ManagedObject("The container of HTTP/2 sessions") public class SessionContainer extends AbstractLifeCycle implements Connection.Listener, Graceful, Dumpable

A container of HTTP/2 Session instances.

This container is part of the Jetty component tree, but the session instances are not part of the component tree for performance reasons.

This container ensures that the session instances are dumped as if they were part of the component tree.

  • Constructor Details

    • SessionContainer

      public SessionContainer()
  • Method Details

    • onOpened

      public void onOpened(Connection connection)
      Specified by:
      onOpened in interface Connection.Listener
    • onClosed

      public void onClosed(Connection connection)
      Specified by:
      onClosed in interface Connection.Listener
    • shutdown

      public CompletableFuture<Void> shutdown()
      Description copied from interface: Graceful
      Shutdown the component. When this method returns, the component should not accept any new load.
      Specified by:
      shutdown in interface Graceful
      Returns:
      A future that is completed once all load on the component is completed
    • isShutdown

      public boolean isShutdown()
      Specified by:
      isShutdown in interface Graceful
      Returns:
      True if Graceful.shutdown() has been called.
    • getSessions

      public Set<Session> getSessions()
    • getSize

      public int getSize()
    • dump

      public void dump(Appendable out, String indent) throws IOException
      Description copied from interface: Dumpable
      Dump this object (and children) into an Appendable using the provided indent after any new lines. The indent should not be applied to the first object dumped.
      Specified by:
      dump in interface Dumpable
      Parameters:
      out - The appendable to dump to
      indent - The indent to apply after any new lines.
      Throws:
      IOException - if unable to write to Appendable
    • toString

      public String toString()
      Overrides:
      toString in class AbstractLifeCycle