public class FrameCaptureExtension extends AbstractExtension
AbstractLifeCycle.AbstractLifeCycleListener
LifeCycle.Listener
Modifier and Type | Field and Description |
---|---|
private static int |
BUFSIZE |
private Generator |
generator |
private java.nio.channels.SeekableByteChannel |
incomingChannel |
private java.util.concurrent.atomic.AtomicInteger |
incomingCount |
private java.nio.file.Path |
incomingFramesPath |
private static Logger |
LOG |
private java.nio.channels.SeekableByteChannel |
outgoingChannel |
private java.util.concurrent.atomic.AtomicInteger |
outgoingCount |
private java.nio.file.Path |
outgoingFramesPath |
private java.nio.file.Path |
outputDir |
private java.lang.String |
prefix |
Constructor and Description |
---|
FrameCaptureExtension() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getName()
The
Sec-WebSocket-Extensions name for this extension. |
void |
incomingFrame(Frame frame)
Process the incoming frame.
|
void |
outgoingFrame(Frame frame,
WriteCallback callback,
BatchMode batchMode)
A frame, and optional callback, intended for the network layer.
|
private void |
saveFrame(Frame frame,
boolean outgoing) |
void |
setConfig(ExtensionConfig config) |
getBufferPool, getConfig, getConnection, getNextIncoming, getNextOutgoing, getPolicy, init, init, isRsv1User, isRsv2User, isRsv3User, nextIncomingFrame, nextOutgoingFrame, setBufferPool, setConnection, setNextIncomingFrames, setNextOutgoingFrames, setPolicy, toString
addLifeCycleListener, doStart, doStop, getState, getState, getStopTimeout, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, setStopTimeout, start, stop
private static final Logger LOG
private static final int BUFSIZE
private Generator generator
private java.nio.file.Path outputDir
private java.lang.String prefix
private java.nio.file.Path incomingFramesPath
private java.nio.file.Path outgoingFramesPath
private java.util.concurrent.atomic.AtomicInteger incomingCount
private java.util.concurrent.atomic.AtomicInteger outgoingCount
private java.nio.channels.SeekableByteChannel incomingChannel
private java.nio.channels.SeekableByteChannel outgoingChannel
public java.lang.String getName()
Extension
Sec-WebSocket-Extensions
name for this extension.
Also known as the extension-token
per Section 9.1. Negotiating Extensions.
getName
in interface Extension
getName
in class AbstractExtension
public void incomingFrame(Frame frame)
IncomingFrames
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.
frame
- the frame to processpublic void outgoingFrame(Frame frame, WriteCallback callback, BatchMode batchMode)
OutgoingFrames
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.
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.private void saveFrame(Frame frame, boolean outgoing)
public void setConfig(ExtensionConfig config)
setConfig
in class AbstractExtension