Top Inners Fields Constructors Methods
org.eclipse.jetty.ee10.websocket.jakarta.common.messages

public abstract Class AbstractDecodedMessageSink

extends Object
implements MessageSink
Class Inheritance
All Implemented Interfaces
org.eclipse.jetty.websocket.core.messages.MessageSink
Known Direct Subclasses
org.eclipse.jetty.ee10.websocket.jakarta.common.messages.AbstractDecodedMessageSink.Basic, org.eclipse.jetty.ee10.websocket.jakarta.common.messages.AbstractDecodedMessageSink.Stream
Imports
java.lang.invoke.MethodHandle, java.util.List, java.util.stream.Collectors, jakarta.websocket.CloseReason, .Decoder, org.eclipse.jetty.ee10.websocket.jakarta.common.decoders.RegisteredDecoder, org.eclipse.jetty.util.Callback, org.eclipse.jetty.websocket.core.CoreSession, .Frame, org.eclipse.jetty.websocket.core.exception.CloseException, org.eclipse.jetty.websocket.core.messages.MessageSink, org.slf4j.Logger, .LoggerFactory

Nested and Inner Type Summary

Modifier and TypeClass and Description
public abstract static class
public abstract static class

Field Summary

Modifier and TypeField and Description
private final MessageSink
private final MethodHandle
private static final Logger

Constructor Summary

AccessConstructor and Description
public

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.

public void
fail(Throwable
the cause of the failure
failure
)

Overrides default org.eclipse.jetty.websocket.core.messages.MessageSink.fail.

Fails this MessageSink with the given cause.

pack-priv void
invoke(Object
the decoded message.
message
)

Invoke the MessageSink with the decoded message.

pack-priv abstract MessageSink
newMessageSink(CoreSession coreSession)

Returns: a message sink which will first decode the message then pass it to _methodHandle.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_messageSinkback to summary
private final MessageSink _messageSink
_methodHandleback to summary
private final MethodHandle _methodHandle
LOGback to summary
private static final Logger LOG

Constructor Detail

AbstractDecodedMessageSinkback to summary
public AbstractDecodedMessageSink(CoreSession coreSession, MethodHandle methodHandle)

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
failback to summary
public void fail(Throwable failure)

Overrides default org.eclipse.jetty.websocket.core.messages.MessageSink.fail.

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

Fails this MessageSink with the given cause.

Parameters
failure:Throwable

the cause of the failure

Annotations
@Override
invokeback to summary
pack-priv void invoke(Object message)

Invoke the MessageSink with the decoded message.

Parameters
message:Object

the decoded message.

newMessageSinkback to summary
pack-priv abstract MessageSink newMessageSink(CoreSession coreSession) throws Exception
Returns:MessageSink

a message sink which will first decode the message then pass it to _methodHandle.

Exceptions
Exception:
for any error in creating the message sink.
org.eclipse.jetty.ee10.websocket.jakarta.common.messages back to summary

public abstract Class AbstractDecodedMessageSink.Basic<T extends Decoder>

extends AbstractDecodedMessageSink
Class Inheritance
Known Direct Subclasses
org.eclipse.jetty.ee10.websocket.jakarta.common.messages.DecodedBinaryMessageSink, org.eclipse.jetty.ee10.websocket.jakarta.common.messages.DecodedTextMessageSink

Field Summary

Modifier and TypeField and Description
protected final List<T>

Constructor Summary

AccessConstructor and Description
public
Basic(CoreSession coreSession, MethodHandle methodHandle, List<RegisteredDecoder> decoders)

Method Summary

Inherited from org.eclipse.jetty.ee10.websocket.jakarta.common.messages.AbstractDecodedMessageSink:
acceptfailinvokenewMessageSink

Field Detail

_decodersback to summary
protected final List<T> _decoders

Constructor Detail

Basicback to summary
public Basic(CoreSession coreSession, MethodHandle methodHandle, List<RegisteredDecoder> decoders)
org.eclipse.jetty.ee10.websocket.jakarta.common.messages back to summary

public abstract Class AbstractDecodedMessageSink.Stream<T extends Decoder>

extends AbstractDecodedMessageSink
Class Inheritance
Known Direct Subclasses
org.eclipse.jetty.ee10.websocket.jakarta.common.messages.DecodedBinaryStreamMessageSink, org.eclipse.jetty.ee10.websocket.jakarta.common.messages.DecodedTextStreamMessageSink

Field Summary

Modifier and TypeField and Description
protected final T

Constructor Summary

AccessConstructor and Description
public
Stream(CoreSession coreSession, MethodHandle methodHandle, List<RegisteredDecoder> decoders)

Method Summary

Inherited from org.eclipse.jetty.ee10.websocket.jakarta.common.messages.AbstractDecodedMessageSink:
acceptfailinvokenewMessageSink

Field Detail

_decoderback to summary
protected final T _decoder

Constructor Detail

Streamback to summary
public Stream(CoreSession coreSession, MethodHandle methodHandle, List<RegisteredDecoder> decoders)