Top Description Fields Constructors Methods
org.springframework.web.reactive.socket.adapter

public Class TomcatWebSocketSession

extends StandardWebSocketSession
Class Inheritance
Imports
java.util.concurrent.atomic.AtomicIntegerFieldUpdater, jakarta.websocket.Session, org.apache.tomcat.websocket.WsSession, reactor.core.publisher.Sinks, org.springframework.core.io.buffer.DataBufferFactory, org.springframework.web.reactive.socket.HandshakeInfo, .WebSocketSession

Spring WebSocketSession adapter for Tomcat's jakarta.websocket.Session.
Author
Violeta Georgieva
Since
5.0

Field Summary

Modifier and TypeField and Description
private static final AtomicIntegerFieldUpdater<TomcatWebSocketSession>
private volatile int

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
protected boolean
canSuspendReceiving()

Overrides org.springframework.web.reactive.socket.adapter.StandardWebSocketSession.canSuspendReceiving.

Whether the underlying WebSocket API has flow control and can suspend and resume the receiving of messages.

protected void
resumeReceiving()

Overrides org.springframework.web.reactive.socket.adapter.StandardWebSocketSession.resumeReceiving.

Resume receiving new message(s) after demand is generated by the downstream Subscriber.

protected void
suspendReceiving()

Overrides org.springframework.web.reactive.socket.adapter.StandardWebSocketSession.suspendReceiving.

Suspend receiving until received message(s) are processed and more demand is generated by the downstream Subscriber.

Inherited from org.springframework.web.reactive.socket.adapter.StandardWebSocketSession:
closeisOpensendMessage

Field Detail

SUSPENDEDback to summary
private static final AtomicIntegerFieldUpdater<TomcatWebSocketSession> SUSPENDED
suspendedback to summary
private volatile int suspended
Annotations
@SuppressWarnings:unused

Constructor Detail

TomcatWebSocketSessionback to summary
public TomcatWebSocketSession(Session session, HandshakeInfo info, DataBufferFactory factory)
TomcatWebSocketSessionback to summary
public TomcatWebSocketSession(Session session, HandshakeInfo info, DataBufferFactory factory, Sinks.Empty<Void> completionSink)

Method Detail

canSuspendReceivingback to summary
protected boolean canSuspendReceiving()

Overrides org.springframework.web.reactive.socket.adapter.StandardWebSocketSession.canSuspendReceiving.

Doc from org.springframework.web.reactive.socket.adapter.AbstractListenerWebSocketSession.canSuspendReceiving.

Whether the underlying WebSocket API has flow control and can suspend and resume the receiving of messages.

Note

Sub-classes are encouraged to start out in suspended mode, if possible, and wait until demand is received.

Annotations
@Override
resumeReceivingback to summary
protected void resumeReceiving()

Overrides org.springframework.web.reactive.socket.adapter.StandardWebSocketSession.resumeReceiving.

Doc from org.springframework.web.reactive.socket.adapter.AbstractListenerWebSocketSession.resumeReceiving.

Resume receiving new message(s) after demand is generated by the downstream Subscriber.

Note

if the underlying WebSocket API does not provide flow control for receiving messages, this method should be a no-op and canSuspendReceiving() should return false.

Annotations
@Override
suspendReceivingback to summary
protected void suspendReceiving()

Overrides org.springframework.web.reactive.socket.adapter.StandardWebSocketSession.suspendReceiving.

Doc from org.springframework.web.reactive.socket.adapter.AbstractListenerWebSocketSession.suspendReceiving.

Suspend receiving until received message(s) are processed and more demand is generated by the downstream Subscriber.

Note

if the underlying WebSocket API does not provide flow control for receiving messages, this method should be a no-op and canSuspendReceiving() should return false.

Annotations
@Override