Package org.eclipse.jetty.websocket.core
Class ExtensionStack
java.lang.Object
org.eclipse.jetty.websocket.core.ExtensionStack
- All Implemented Interfaces:
Dumpable
,IncomingFrames
,OutgoingFrames
@ManagedObject("Extension Stack")
public class ExtensionStack
extends Object
implements IncomingFrames, OutgoingFrames, Dumpable
Represents the stack of Extensions.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainer
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
demand()
dump()
void
dump
(Appendable out, String indent) Dump this object (and children) into an Appendable using the provided indent after any new lines.dumpSelf()
The description of this/self found in the dump.Get the list of negotiated extensions, each entry being a full "name; params" extension configurationboolean
void
initialize
(IncomingFrames incoming, OutgoingFrames outgoing, CoreSession coreSession) boolean
boolean
boolean
void
negotiate
(List<ExtensionConfig> offeredConfigs, List<ExtensionConfig> negotiatedConfigs) Perform the extension negotiation.void
Process the incoming frame.void
A frame, and optional callback, intended for the network layer.void
setLastDemand
(DemandChain lastDemand) toString()
-
Constructor Details
-
ExtensionStack
-
-
Method Details
-
close
public void close() -
getExtensions
-
getNegotiatedExtensions
Get the list of negotiated extensions, each entry being a full "name; params" extension configuration- Returns:
- list of negotiated extensions
-
getNextIncoming
@ManagedAttribute(name="Next Incoming Frames Handler", readonly=true) public IncomingFrames getNextIncoming() -
getNextOutgoing
@ManagedAttribute(name="Next Outgoing Frames Handler", readonly=true) public OutgoingFrames getNextOutgoing() -
hasNegotiatedExtensions
public boolean hasNegotiatedExtensions() -
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.
-
negotiate
public void negotiate(List<ExtensionConfig> offeredConfigs, List<ExtensionConfig> negotiatedConfigs) Perform the extension negotiation.For the list of negotiated extensions, use
getNegotiatedExtensions()
- Parameters:
offeredConfigs
- the configurations being requested by the clientnegotiatedConfigs
- the configurations accepted by the server
-
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.
-
initialize
-
demand
public void demand() -
setLastDemand
-
getRsv1User
-
getRsv2User
-
getRsv3User
-
isRsv1Used
public boolean isRsv1Used() -
isRsv2Used
public boolean isRsv2Used() -
isRsv3Used
public boolean isRsv3Used() -
dump
-
dump
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 interfaceDumpable
- Parameters:
out
- The appendable to dump toindent
- The indent to apply after any new lines.- Throws:
IOException
- if unable to write to Appendable
-
dumpSelf
Description copied from interface:Dumpable
The description of this/self found in the dump. Allows for alternative representation of Object other then .toString() where the long form output of toString() is represented in a cleaner way within the dump infrastructure. -
toString
-