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

public Class FragmentExtension

extends AbstractExtension
implements DemandChain
Class Inheritance
All Implemented Interfaces
org.eclipse.jetty.websocket.core.util.DemandChain
Imports
java.nio.ByteBuffer, org.eclipse.jetty.util.Callback, org.eclipse.jetty.websocket.core.AbstractExtension, .Configuration, .ExtensionConfig, .Frame, .OpCode, .WebSocketComponents, org.eclipse.jetty.websocket.core.util.DemandChain, .DemandingFlusher, .FragmentingFlusher, org.slf4j.Logger, .LoggerFactory

Fragment Extension

Nested and Inner Type Summary

Modifier and TypeClass and Description
public class

Field Summary

Modifier and TypeField and Description
private final Configuration
private final DemandingFlusher
private static final Logger
private final FragmentingFlusher

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
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.

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.

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

Field Detail

configurationback to summary
private final Configuration configuration
incomingFlusherback to summary
private final DemandingFlusher incomingFlusher
LOGback to summary
private static final Logger LOG
outgoingFlusherback to summary
private final FragmentingFlusher outgoingFlusher

Constructor Detail

FragmentExtensionback to summary
public FragmentExtension()

Method Detail

demandback to summary
public void demand()

Implements org.eclipse.jetty.websocket.core.util.DemandChain.demand.

Annotations
@Override
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
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
setNextDemandback to summary
public void setNextDemand(DemandChain nextDemand)

Overrides default org.eclipse.jetty.websocket.core.util.DemandChain.setNextDemand.

Annotations
@Override
org.eclipse.jetty.websocket.core.internal back to summary

public Class FragmentExtension.FragmentingDemandingFlusher

extends DemandingFlusher
Class Inheritance

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected boolean
handle(Frame
the original frame.
frame
,
Callback
to succeed to release the frame payload.
callback
,
boolean
if this is the first time this method has been called for this frame.
first
)

Implements abstract org.eclipse.jetty.websocket.core.util.DemandingFlusher.handle.

Called when there is demand for a single frame to be produced.

Inherited from org.eclipse.jetty.websocket.core.util.DemandingFlusher:
closeFlusherdemandemitFramefailFlusheronCompleteFailureonFrameprocesssetNextDemand

Constructor Detail

FragmentingDemandingFlusherback to summary
public FragmentingDemandingFlusher()

Method Detail

handleback to summary
protected boolean handle(Frame frame, Callback callback, boolean first)

Implements abstract org.eclipse.jetty.websocket.core.util.DemandingFlusher.handle.

Doc from org.eclipse.jetty.websocket.core.util.DemandingFlusher.handle.

Called when there is demand for a single frame to be produced. During this method a single call can be made to emitFrame(Frame, Callback) which will forward this frame towards the application. Returning true from this method signals that you are done processing the current Frame, and the next invocation of this method will have the next frame.

Note that the callback supplied here is specially wrapped so that you can call it multiple times and it will not be completed more than once. This simplifies the handling of failure cases.

Parameters
frame:Frame

the original frame.

callback:Callback

to succeed to release the frame payload.

first:boolean

if this is the first time this method has been called for this frame.

Returns:boolean

false to continue processing this frame, true to complete processing and get a new frame.

Annotations
@Override