Package org.glassfish.tyrus.core.frame
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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TyrusFrame.FrameType
An Enumeration of frame types.-
Nested classes/interfaces inherited from class org.glassfish.tyrus.core.frame.Frame
Frame.Builder
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
TyrusFrame(Frame frame, TyrusFrame.FrameType frameType)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description TyrusFrame.FrameType
getFrameType()
Returns the type of the frame.abstract void
respond(TyrusWebSocket socket)
Execution part of frame processing.static TyrusFrame
wrap(Frame frame, byte inFragmentedType, java.nio.ByteBuffer remainder)
TyrusFrame
factory method.-
Methods inherited from class org.glassfish.tyrus.core.frame.Frame
builder, builder, getMaskingKey, getOpcode, getPayloadData, getPayloadLength, isControlFrame, isFin, isMask, isRsv1, isRsv2, isRsv3, toString
-
-
-
-
Constructor Detail
-
TyrusFrame
protected TyrusFrame(Frame frame, TyrusFrame.FrameType frameType)
Constructor.- Parameters:
frame
- enriched frame.frameType
- type of the frame.
-
-
Method Detail
-
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, java.nio.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.
-
-