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

public Class AbstractExtension

extends Object
implements Extension
Class Inheritance
All Implemented Interfaces
org.eclipse.jetty.websocket.core.Extension, java.io.Closeable, java.lang.AutoCloseable, org.eclipse.jetty.websocket.core.OutgoingFrames, org.eclipse.jetty.websocket.core.IncomingFrames
Known Direct Subclasses
org.eclipse.jetty.websocket.core.internal.FragmentExtension, org.eclipse.jetty.websocket.core.internal.FrameCaptureExtension, org.eclipse.jetty.websocket.core.internal.IdentityExtension, org.eclipse.jetty.websocket.core.internal.PerMessageDeflateExtension, org.eclipse.jetty.websocket.core.internal.ValidationExtension
Annotations
@ManagedObject:Abstract Extension
Imports
org.eclipse.jetty.io.ByteBufferPool, org.eclipse.jetty.util.Callback, org.eclipse.jetty.util.annotation.ManagedAttribute, .ManagedObject, org.eclipse.jetty.util.compression.DeflaterPool, .InflaterPool, org.slf4j.Logger, .LoggerFactory

Field Summary

Modifier and TypeField and Description
private ByteBufferPool
private ExtensionConfig
private CoreSession
private DeflaterPool
private InflaterPool
private final Logger
private IncomingFrames
private OutgoingFrames

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public ByteBufferPool
public ExtensionConfig
getConfig()

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

The active configuration for this extension.

protected Configuration
public CoreSession
public DeflaterPool
public InflaterPool
public String
getName()

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

The Sec-WebSocket-Extensions name for this extension.

public IncomingFrames
public OutgoingFrames
public void
public boolean

Returns:

true if extension uses RSV1 for its own purposes.
isRsv1User
()

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

Used to indicate that the extension makes use of the RSV1 bit of the base websocket framing.

public boolean

Returns:

true if extension uses RSV2 for its own purposes.
isRsv2User
()

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

Used to indicate that the extension makes use of the RSV2 bit of the base websocket framing.

public boolean

Returns:

true if extension uses RSV3 for its own purposes.
isRsv3User
()

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

Used to indicate that the extension makes use of the RSV3 bit of the base websocket framing.

protected void
nextIncomingFrame(Frame frame, Callback callback)

protected void
nextOutgoingFrame(Frame frame, Callback callback, boolean batch)

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

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
)

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

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

public void
setCoreSession(CoreSession
the CoreSession for this Extension.
coreSession
)

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

Set the CoreSession for this Extension..

public void
setNextIncomingFrames(IncomingFrames
the next incoming extension
nextIncoming
)

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

Set the next IncomingFrames to call in the chain.

public void
setNextOutgoingFrames(OutgoingFrames
the next outgoing extension
nextOutgoing
)

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

Set the next OutgoingFrames to call in the chain.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

bufferPoolback to summary
private ByteBufferPool bufferPool
configback to summary
private ExtensionConfig config
coreSessionback to summary
private CoreSession coreSession
deflaterPoolback to summary
private DeflaterPool deflaterPool
inflaterPoolback to summary
private InflaterPool inflaterPool
logback to summary
private final Logger log
nextIncomingback to summary
private IncomingFrames nextIncoming
nextOutgoingback to summary
private OutgoingFrames nextOutgoing

Constructor Detail

AbstractExtensionback to summary
public AbstractExtension()

Method Detail

getByteBufferPoolback to summary
public ByteBufferPool getByteBufferPool()
getConfigback to summary
public ExtensionConfig getConfig()

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

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

The active configuration for this extension.

Returns:ExtensionConfig

the configuration for this extension. never null.

Annotations
@Override
getConfigurationback to summary
protected Configuration getConfiguration()
getCoreSessionback to summary
public CoreSession getCoreSession()
getDeflaterPoolback to summary
public DeflaterPool getDeflaterPool()
getInflaterPoolback to summary
public InflaterPool getInflaterPool()
getNameback to summary
public String 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
getNextIncomingback to summary
public IncomingFrames getNextIncoming()
Annotations
@ManagedAttribute
name:Next Incoming Frame Handler
readonly:true
getNextOutgoingback to summary
public OutgoingFrames getNextOutgoing()
Annotations
@ManagedAttribute
name:Next Outgoing Frame Handler
readonly:true
initback to summary
public void init(ExtensionConfig config, WebSocketComponents components)

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

Annotations
@Override
isRsv1Userback to summary
public boolean isRsv1User()

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

Used to indicate that the extension makes use of the RSV1 bit of the base websocket framing.

This is used to adjust validation during parsing, as well as a checkpoint against 2 or more extensions all simultaneously claiming ownership of RSV1.

Returns:boolean

true if extension uses RSV1 for its own purposes.

Annotations
@Override
isRsv2Userback to summary
public boolean isRsv2User()

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

Used to indicate that the extension makes use of the RSV2 bit of the base websocket framing.

This is used to adjust validation during parsing, as well as a checkpoint against 2 or more extensions all simultaneously claiming ownership of RSV2.

Returns:boolean

true if extension uses RSV2 for its own purposes.

Annotations
@Override
isRsv3Userback to summary
public boolean isRsv3User()

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

Used to indicate that the extension makes use of the RSV3 bit of the base websocket framing.

This is used to adjust validation during parsing, as well as a checkpoint against 2 or more extensions all simultaneously claiming ownership of RSV3.

Returns:boolean

true if extension uses RSV3 for its own purposes.

Annotations
@Override
nextIncomingFrameback to summary
protected void nextIncomingFrame(Frame frame, Callback callback)
nextOutgoingFrameback to summary
protected void nextOutgoingFrame(Frame frame, Callback callback, boolean batch)
onFrameback to summary
public void onFrame(Frame frame, Callback callback)

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)

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
setCoreSessionback to summary
public void setCoreSession(CoreSession coreSession)

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

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

Set the CoreSession for this Extension..

Parameters
coreSession:CoreSession

the CoreSession for this Extension.

Annotations
@Override
setNextIncomingFramesback to summary
public void setNextIncomingFrames(IncomingFrames nextIncoming)

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

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

Set the next IncomingFrames to call in the chain.

Parameters
nextIncoming:IncomingFrames

the next incoming extension

Annotations
@Override
setNextOutgoingFramesback to summary
public void setNextOutgoingFrames(OutgoingFrames nextOutgoing)

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

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

Set the next OutgoingFrames to call in the chain.

Parameters
nextOutgoing:OutgoingFrames

the next outgoing extension

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override