Class ByteBufferMessageSink
java.lang.Object
org.eclipse.jetty.websocket.core.messages.AbstractMessageSink
org.eclipse.jetty.websocket.core.messages.ByteBufferMessageSink
- All Implemented Interfaces:
MessageSink
- Direct Known Subclasses:
ByteBufferMessageSink
A MessageSink
implementation that accumulates BINARY frames
into a message that is then delivered to the application function
passed to the constructor in the form of a ByteBuffer
.
-
Constructor Summary
ModifierConstructorDescriptionByteBufferMessageSink
(CoreSession session, MethodHandle methodHandle, boolean autoDemand) Creates a newByteBufferMessageSink
.protected
ByteBufferMessageSink
(CoreSession session, MethodHandle methodHandle, boolean autoDemand, boolean validateSignature) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Consumes the WebSocket frame, possibly asynchronously when this method has returned.void
Fails thisMessageSink
with the given cause.protected void
invoke
(MethodHandle methodHandle, ByteBuffer byteBuffer, Callback callback) Methods inherited from class org.eclipse.jetty.websocket.core.messages.AbstractMessageSink
autoDemand, getCoreSession, getMethodHandle, isAutoDemand
-
Constructor Details
-
ByteBufferMessageSink
Creates a newByteBufferMessageSink
.- Parameters:
session
- the WebSocket sessionmethodHandle
- the application function to invoke when a new message has been assembledautoDemand
- whether thisMessageSink
manages demand automatically
-
ByteBufferMessageSink
protected ByteBufferMessageSink(CoreSession session, MethodHandle methodHandle, boolean autoDemand, boolean validateSignature)
-
-
Method Details
-
accept
Description copied from interface:MessageSink
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
- the frame to consumecallback
- the callback to complete when the frame is consumed
-
fail
Description copied from interface:MessageSink
Fails this
MessageSink
with the given cause.- Parameters:
failure
- the cause of the failure
-
invoke
protected void invoke(MethodHandle methodHandle, ByteBuffer byteBuffer, Callback callback) throws Throwable - Throws:
Throwable
-