Class ExtensionStack

java.lang.Object
org.eclipse.jetty.websocket.core.internal.ExtensionStack
All Implemented Interfaces:
Dumpable, IncomingFrames, OutgoingFrames

@ManagedObject("Extension Stack") public class ExtensionStack extends Object implements IncomingFrames, OutgoingFrames, Dumpable
Represents the stack of Extensions.
  • Constructor Details

  • Method Details

    • close

      public void close()
    • getExtensions

      @ManagedAttribute(name="Extension List", readonly=true) public List<Extension> getExtensions()
    • getNegotiatedExtensions

      public List<ExtensionConfig> 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

      public void onFrame(Frame frame, Callback callback)
      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 close Frame if one has not been sent.

      Specified by:
      onFrame in interface IncomingFrames
      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 client
      negotiatedConfigs - the configurations accepted by the server
    • sendFrame

      public void sendFrame(Frame frame, Callback callback, boolean batch)
      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 WriteCallback appropriately.

      Specified by:
      sendFrame in interface OutgoingFrames
      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

      public void initialize(IncomingFrames incoming, OutgoingFrames outgoing, WebSocketCoreSession coreSession)
    • demand

      public void demand(long n)
    • setLastDemand

      public void setLastDemand(LongConsumer lastDemand)
    • getRsv1User

      public Extension getRsv1User()
    • getRsv2User

      public Extension getRsv2User()
    • getRsv3User

      public Extension getRsv3User()
    • isRsv1Used

      public boolean isRsv1Used()
    • isRsv2Used

      public boolean isRsv2Used()
    • isRsv3Used

      public boolean isRsv3Used()
    • dump

      public String dump()
      Specified by:
      dump in interface Dumpable
    • dump

      public void dump(Appendable out, String indent) throws IOException
      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 interface Dumpable
      Parameters:
      out - The appendable to dump to
      indent - The indent to apply after any new lines.
      Throws:
      IOException - if unable to write to Appendable
    • dumpSelf

      public String 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.
      Specified by:
      dumpSelf in interface Dumpable
      Returns:
      the representation of self
    • toString

      public String toString()
      Overrides:
      toString in class Object