Class FrameCaptureExtension
- java.lang.Object
-
- org.eclipse.jetty.util.component.AbstractLifeCycle
-
- org.eclipse.jetty.websocket.common.extensions.AbstractExtension
-
- org.eclipse.jetty.websocket.common.extensions.FrameCaptureExtension
-
- All Implemented Interfaces:
org.eclipse.jetty.util.component.LifeCycle,Extension,IncomingFrames,OutgoingFrames
public class FrameCaptureExtension extends AbstractExtension
-
-
Field Summary
Fields Modifier and Type Field Description private static intBUFSIZEprivate Generatorgeneratorprivate java.nio.channels.SeekableByteChannelincomingChannelprivate java.util.concurrent.atomic.AtomicIntegerincomingCountprivate java.nio.file.PathincomingFramesPathprivate static org.eclipse.jetty.util.log.LoggerLOGprivate java.nio.channels.SeekableByteChanneloutgoingChannelprivate java.util.concurrent.atomic.AtomicIntegeroutgoingCountprivate java.nio.file.PathoutgoingFramesPathprivate java.nio.file.PathoutputDirprivate java.lang.Stringprefix
-
Constructor Summary
Constructors Constructor Description FrameCaptureExtension()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetName()TheSec-WebSocket-Extensionsname for this extension.voidincomingFrame(Frame frame)Process the incoming frame.voidoutgoingFrame(Frame frame, WriteCallback callback, BatchMode batchMode)A frame, and optional callback, intended for the network layer.private voidsaveFrame(Frame frame, boolean outgoing)voidsetConfig(ExtensionConfig config)-
Methods inherited from class org.eclipse.jetty.websocket.common.extensions.AbstractExtension
getBufferPool, getConfig, getConnection, getNextIncoming, getNextOutgoing, getPolicy, init, init, isRsv1User, isRsv2User, isRsv3User, nextIncomingFrame, nextOutgoingFrame, setBufferPool, setConnection, setNextIncomingFrames, setNextOutgoingFrames, setPolicy, toString
-
-
-
-
Field Detail
-
LOG
private static final org.eclipse.jetty.util.log.Logger LOG
-
BUFSIZE
private static final int BUFSIZE
- See Also:
- Constant Field Values
-
generator
private Generator generator
-
outputDir
private java.nio.file.Path outputDir
-
prefix
private java.lang.String prefix
-
incomingFramesPath
private java.nio.file.Path incomingFramesPath
-
outgoingFramesPath
private java.nio.file.Path outgoingFramesPath
-
incomingCount
private java.util.concurrent.atomic.AtomicInteger incomingCount
-
outgoingCount
private java.util.concurrent.atomic.AtomicInteger outgoingCount
-
incomingChannel
private java.nio.channels.SeekableByteChannel incomingChannel
-
outgoingChannel
private java.nio.channels.SeekableByteChannel outgoingChannel
-
-
Method Detail
-
getName
public java.lang.String getName()
Description copied from interface:ExtensionTheSec-WebSocket-Extensionsname for this extension.Also known as the
extension-tokenper Section 9.1. Negotiating Extensions.- Specified by:
getNamein interfaceExtension- Overrides:
getNamein classAbstractExtension- Returns:
- the name of the extension
-
incomingFrame
public void incomingFrame(Frame frame)
Description copied from interface:IncomingFramesProcess 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.
- Parameters:
frame- the frame to process
-
outgoingFrame
public void outgoingFrame(Frame frame, WriteCallback callback, BatchMode batchMode)
Description copied from interface:OutgoingFramesA 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.
- Parameters:
frame- the frame to eventually write to the network layer.callback- the callback to notify when the frame is written.batchMode- the batch mode requested by the sender.
-
saveFrame
private void saveFrame(Frame frame, boolean outgoing)
-
setConfig
public void setConfig(ExtensionConfig config)
- Overrides:
setConfigin classAbstractExtension
-
-