Top Fields Constructors Methods
org.eclipse.jetty.websocket.core.internal

public Class FrameCaptureExtension

extends AbstractExtension
Class Inheritance
Imports
java.io.File, .IOException, java.nio.ByteBuffer, java.nio.channels.SeekableByteChannel, java.nio.file.Files, .Path, java.util.Calendar, java.util.concurrent.atomic.AtomicInteger, org.eclipse.jetty.io.RetainableByteBuffer, org.eclipse.jetty.util.Callback, .IO, .StringUtil, org.eclipse.jetty.websocket.core.AbstractExtension, .ExtensionConfig, .Frame, .WebSocketComponents, org.slf4j.Logger, .LoggerFactory

Field Summary

Modifier and TypeField and Description
private static final int
private Generator
private SeekableByteChannel
private final AtomicInteger
private Path
private static final Logger
private SeekableByteChannel
private final AtomicInteger
private Path
private Path
private String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String
getName()

Overrides org.eclipse.jetty.websocket.core.AbstractExtension.getName.

Implements org.eclipse.jetty.websocket.core.Extension.getName.

The Sec-WebSocket-Extensions name for this extension.

public void
public void
onFrame(Frame
the frame to process.
frame
,
Callback
the read completion.
callback
)

Overrides org.eclipse.jetty.websocket.core.AbstractExtension.onFrame.

Implements org.eclipse.jetty.websocket.core.IncomingFrames.onFrame.

Process the incoming frame.

private void
saveFrame(Frame frame, boolean outgoing)

public void
sendFrame(Frame
the frame to eventually write to the network layer.
frame
,
Callback
the callback to notify when the frame is written.
callback
,
boolean
the batch mode requested by the sender.
batch
)

Overrides org.eclipse.jetty.websocket.core.AbstractExtension.sendFrame.

Implements org.eclipse.jetty.websocket.core.OutgoingFrames.sendFrame.

A frame, and optional callback, intended for the network layer.

Inherited from org.eclipse.jetty.websocket.core.AbstractExtension:
getByteBufferPoolgetConfiggetConfigurationgetCoreSessiongetDeflaterPoolgetInflaterPoolgetNextIncominggetNextOutgoingisRsv1UserisRsv2UserisRsv3UsernextIncomingFramenextOutgoingFramesetCoreSessionsetNextIncomingFramessetNextOutgoingFramestoString

Field Detail

BUFSIZEback to summary
private static final int BUFSIZE
generatorback to summary
private Generator generator
incomingChannelback to summary
private SeekableByteChannel incomingChannel
incomingCountback to summary
private final AtomicInteger incomingCount
incomingFramesPathback to summary
private Path incomingFramesPath
LOGback to summary
private static final Logger LOG
outgoingChannelback to summary
private SeekableByteChannel outgoingChannel
outgoingCountback to summary
private final AtomicInteger outgoingCount
outgoingFramesPathback to summary
private Path outgoingFramesPath
outputDirback to summary
private Path outputDir
prefixback to summary
private String prefix

Constructor Detail

FrameCaptureExtensionback to summary
public FrameCaptureExtension()

Method Detail

getNameback to summary
public String getName()

Overrides org.eclipse.jetty.websocket.core.AbstractExtension.getName.

Implements org.eclipse.jetty.websocket.core.Extension.getName.

Doc from org.eclipse.jetty.websocket.core.Extension.getName.

The Sec-WebSocket-Extensions name for this extension.

Also known as the extension-token per Section 9.1. Negotiating Extensions.

Returns:String

the name of the extension

Annotations
@Override
initback to summary
public void init(ExtensionConfig config, WebSocketComponents components)

Overrides org.eclipse.jetty.websocket.core.AbstractExtension.init.

Implements org.eclipse.jetty.websocket.core.Extension.init.

Annotations
@Override
onFrameback to summary
public void onFrame(Frame frame, Callback callback)

Overrides org.eclipse.jetty.websocket.core.AbstractExtension.onFrame.

Implements org.eclipse.jetty.websocket.core.IncomingFrames.onFrame.

Doc from org.eclipse.jetty.websocket.core.IncomingFrames.onFrame.

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.

Parameters
frame:Frame

the frame to process.

callback:Callback

the read completion.

Annotations
@Override
saveFrameback to summary
private void saveFrame(Frame frame, boolean outgoing)
sendFrameback to summary
public void sendFrame(Frame frame, Callback callback, boolean batch)

Overrides org.eclipse.jetty.websocket.core.AbstractExtension.sendFrame.

Implements org.eclipse.jetty.websocket.core.OutgoingFrames.sendFrame.

Doc from org.eclipse.jetty.websocket.core.OutgoingFrames.sendFrame.

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.

Parameters
frame:Frame

the frame to eventually write to the network layer.

callback:Callback

the callback to notify when the frame is written.

batch:boolean

the batch mode requested by the sender.

Annotations
@Override