Class AbstractExtension
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Extension
,IncomingFrames
,OutgoingFrames
- Direct Known Subclasses:
FragmentExtension
,FrameCaptureExtension
,IdentityExtension
,PerMessageDeflateExtension
,ValidationExtension
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionThe active configuration for this extension.protected Configuration
getName()
TheSec-WebSocket-Extensions
name for this extension.void
init
(ExtensionConfig config, WebSocketComponents components) boolean
Used to indicate that the extension makes use of the RSV1 bit of the base websocket framing.boolean
Used to indicate that the extension makes use of the RSV2 bit of the base websocket framing.boolean
Used to indicate that the extension makes use of the RSV3 bit of the base websocket framing.protected void
nextIncomingFrame
(Frame frame, Callback callback) protected void
nextOutgoingFrame
(Frame frame, Callback callback, boolean batch) void
Process the incoming frame.void
A frame, and optional callback, intended for the network layer.void
setCoreSession
(CoreSession coreSession) Set theCoreSession
for this Extension..void
setNextIncomingFrames
(IncomingFrames nextIncoming) Set the nextIncomingFrames
to call in the chain.void
setNextOutgoingFrames
(OutgoingFrames nextOutgoing) Set the nextOutgoingFrames
to call in the chain.toString()
-
Constructor Details
-
AbstractExtension
public AbstractExtension()
-
-
Method Details
-
init
-
onFrame
Description copied from interface:IncomingFrames
Process the incoming frame.
Note: if you need to hang onto any information from the frame, be sure to copy it, as the information contained in the Frame will be released and/or reused by the implementation.
Failure of the callback will propagate the failure back to the
CoreSession
to fail the connection and attempt to send a closeFrame
if one has not been sent.- Specified by:
onFrame
in interfaceIncomingFrames
- Parameters:
frame
- the frame to process.callback
- the read completion.
-
sendFrame
Description copied from interface:OutgoingFrames
A frame, and optional callback, intended for the network layer.Note: the frame can undergo many transformations in the various layers and extensions present in the implementation.
If you are implementing a mutation, you are obliged to handle the incoming Callback appropriately.
- Specified by:
sendFrame
in interfaceOutgoingFrames
- Parameters:
frame
- the frame to eventually write to the network layer.callback
- the callback to notify when the frame is written.batch
- the batch mode requested by the sender.
-
getByteBufferPool
-
getConfig
Description copied from interface:Extension
The active configuration for this extension. -
getDeflaterPool
-
getInflaterPool
-
getName
Description copied from interface:Extension
TheSec-WebSocket-Extensions
name for this extension.Also known as the
extension-token
per Section 9.1. Negotiating Extensions. -
getNextIncoming
@ManagedAttribute(name="Next Incoming Frame Handler", readonly=true) public IncomingFrames getNextIncoming() -
getNextOutgoing
@ManagedAttribute(name="Next Outgoing Frame Handler", readonly=true) public OutgoingFrames getNextOutgoing() -
isRsv1User
public boolean isRsv1User()Used to indicate that the extension makes use of the RSV1 bit of the base websocket framing.This is used to adjust validation during parsing, as well as a checkpoint against 2 or more extensions all simultaneously claiming ownership of RSV1.
- Specified by:
isRsv1User
in interfaceExtension
- Returns:
- true if extension uses RSV1 for its own purposes.
-
isRsv2User
public boolean isRsv2User()Used to indicate that the extension makes use of the RSV2 bit of the base websocket framing.This is used to adjust validation during parsing, as well as a checkpoint against 2 or more extensions all simultaneously claiming ownership of RSV2.
- Specified by:
isRsv2User
in interfaceExtension
- Returns:
- true if extension uses RSV2 for its own purposes.
-
isRsv3User
public boolean isRsv3User()Used to indicate that the extension makes use of the RSV3 bit of the base websocket framing.This is used to adjust validation during parsing, as well as a checkpoint against 2 or more extensions all simultaneously claiming ownership of RSV3.
- Specified by:
isRsv3User
in interfaceExtension
- Returns:
- true if extension uses RSV3 for its own purposes.
-
nextIncomingFrame
-
nextOutgoingFrame
-
setNextIncomingFrames
Description copied from interface:Extension
Set the nextIncomingFrames
to call in the chain.- Specified by:
setNextIncomingFrames
in interfaceExtension
- Parameters:
nextIncoming
- the next incoming extension
-
setNextOutgoingFrames
Description copied from interface:Extension
Set the nextOutgoingFrames
to call in the chain.- Specified by:
setNextOutgoingFrames
in interfaceExtension
- Parameters:
nextOutgoing
- the next outgoing extension
-
setCoreSession
Description copied from interface:Extension
Set theCoreSession
for this Extension..- Specified by:
setCoreSession
in interfaceExtension
- Parameters:
coreSession
- theCoreSession
for this Extension.
-
getCoreSession
-
getConfiguration
-
toString
-