Top Description Constructors Methods
org.eclipse.jetty.websocket.core.messages

public Class PartialByteBufferMessageSink

extends AbstractMessageSink
Class Inheritance
Imports
java.lang.invoke.MethodHandle, java.nio.ByteBuffer, org.eclipse.jetty.util.Callback, org.eclipse.jetty.websocket.core.CoreSession, .Frame

A MessageSink implementation that delivers BINARY frames to the application function passed to the constructor in the form of a ByteBuffer.

Constructor Summary

AccessConstructor and Description
public
PartialByteBufferMessageSink(CoreSession
the WebSocket session
session
,
MethodHandle
the application function to invoke when a new frame has arrived
methodHandle
,
boolean
whether this MessageSink manages demand automatically
autoDemand
)

Creates a new PartialByteBufferMessageSink.

Method Summary

Modifier and TypeMethod and Description
public void
accept(Frame
the frame to consume
frame
,
Callback
the callback to complete when the frame is consumed
callback
)

Implements org.eclipse.jetty.websocket.core.messages.MessageSink.accept.

Consumes the WebSocket frame, possibly asynchronously when this method has returned.

protected void
invoke(MethodHandle methodHandle, ByteBuffer byteBuffer, boolean fin, Callback callback)

Inherited from org.eclipse.jetty.websocket.core.messages.AbstractMessageSink:
autoDemandgetCoreSessiongetMethodHandleisAutoDemand

Constructor Detail

PartialByteBufferMessageSinkback to summary
public PartialByteBufferMessageSink(CoreSession session, MethodHandle methodHandle, boolean autoDemand)

Creates a new PartialByteBufferMessageSink.

Parameters
session:CoreSession

the WebSocket session

methodHandle:MethodHandle

the application function to invoke when a new frame has arrived

autoDemand:boolean

whether this MessageSink manages demand automatically

Method Detail

acceptback to summary
public void accept(Frame frame, Callback callback)

Implements org.eclipse.jetty.websocket.core.messages.MessageSink.accept.

Doc from org.eclipse.jetty.websocket.core.messages.MessageSink.accept.

Consumes the WebSocket frame, possibly asynchronously when this method has returned.

The callback argument must be completed when the frame payload is consumed.

The demand for more frames must be explicitly invoked, or arranged to be invoked asynchronously, by the implementation of this method, by calling CoreSession#demand().

Parameters
frame:Frame

the frame to consume

callback:Callback

the callback to complete when the frame is consumed

Annotations
@Override
invokeback to summary
protected void invoke(MethodHandle methodHandle, ByteBuffer byteBuffer, boolean fin, Callback callback) throws Throwable