Class TyrusFrame

java.lang.Object
org.glassfish.tyrus.core.frame.Frame
org.glassfish.tyrus.core.frame.TyrusFrame
Direct Known Subclasses:
BinaryFrame, CloseFrame, PingFrame, PongFrame, TextFrame

public abstract class TyrusFrame extends Frame
Frame representation used in Tyrus runtime.

Enriched Frame representation.

Author:
Pavel Bucek
  • Constructor Details

    • TyrusFrame

      protected TyrusFrame(Frame frame, TyrusFrame.FrameType frameType)
      Constructor.
      Parameters:
      frame - enriched frame.
      frameType - type of the frame.
  • Method Details

    • respond

      public abstract void respond(TyrusWebSocket socket)
      Execution part of frame processing.
      Parameters:
      socket - socket on which the appropriate action will be performed.
    • getFrameType

      public TyrusFrame.FrameType getFrameType()
      Returns the type of the frame. It is used for distinguishing frame types in monitoring.

      TODO: consider moving this to "MonitoredFrame" or something like this;

      Returns:
      type of the frame.
    • wrap

      public static TyrusFrame wrap(Frame frame, byte inFragmentedType, ByteBuffer remainder)
      TyrusFrame factory method.
      Parameters:
      frame - original plain frame.
      inFragmentedType - type of fragment (text or binary).
      remainder - decoding remainder. Used only for partial text frames.
      Returns:
      new TyrusFrame.