Interface HTTP2Session.FrameListener

All Superinterfaces:
EventListener
Enclosing class:
HTTP2Session

public static interface HTTP2Session.FrameListener extends EventListener

Listener for processable HTTP/2 frames that have been received.

Non-processable frames, such as those that caused a low-level protocol error, or those that exceed frame rate control, are not notified to instances of this class.

Applications can register instances of this class either directly on the HTTP/2 session via HTTP2Session.addEventListener(EventListener), or by adding the instances as beans to either the HTTP2Client (on the client), or the HTTP/2 ConnectionFactory (on the server).

Applications may invoke effect-free methods on the Session object received in the methods of this class, such as Session.getRemoteSocketAddress() or Session.getStreams(), but should not invoke Session methods that are effect-ful, such as Session.close(int, String, Callback) or Session.newStream(HeadersFrame, Promise, Stream.Listener), since they may result in undefined behavior.

Instances of this class must be stateless or thread-safe, since the same instance will be registered for all sessions.

Consider using HTTP2Session.LifeCycleListener if you need to maintain per-session state.

  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    onIncomingFrame(Session session, Frame frame)
    Invoked when a processable HTTP/2 frame has been received.
    default void
    onOutgoingFrame(Session session, Frame frame)
    Invoked when a processable HTTP/2 frame is about to be sent.
  • Method Details

    • onIncomingFrame

      default void onIncomingFrame(Session session, Frame frame)

      Invoked when a processable HTTP/2 frame has been received.

      Parameters:
      session - the associated HTTP/2 session
      frame - the HTTP/2 frame
    • onOutgoingFrame

      default void onOutgoingFrame(Session session, Frame frame)

      Invoked when a processable HTTP/2 frame is about to be sent.

      Parameters:
      session - the associated HTTP/2 session
      frame - the HTTP/2 frame