Package io.fluxcapacitor.javaclient.web
Class SocketEndpointHandler.SocketEndpointWrapper
java.lang.Object
io.fluxcapacitor.javaclient.web.SocketEndpointHandler.SocketEndpointWrapper
- Enclosing class:
SocketEndpointHandler
A stateful wrapper around a WebSocket endpoint instance, managing per-session behavior and message handling.
This class is created per WebSocket session and holds:
- A lazily instantiated target handler
- Connection health tracking (ping/pong logic)
- Automatic session cleanup via
Registration
hooks - Delegation to matching methods for open, message, pong, and close events
When the first @HandleSocketOpen
or @HandleSocketMessage
message arrives for a session,
the target handler is initialized and stored. Subsequent WebSocket lifecycle messages (e.g. @HandleSocketPong
,
@HandleSocketClose
) are routed to the correct methods on the same instance.
Ping scheduling and timeout behavior is based on the SocketEndpoint.aliveCheck()
configuration.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
abort
(int closeCode) protected boolean
isOpen()
protected void
onClose
(DeserializingMessage message) protected Object
onOpenOrMessage
(SocketSession session, DeserializingMessage message) protected void
onPong
(DeserializingMessage message) protected void
sendPing
(Duration pingTimeout, TaskScheduler taskScheduler) protected void
protected Object
unwrap()
-
Constructor Details
-
SocketEndpointWrapper
public SocketEndpointWrapper()
-
-
Method Details
-
onOpenOrMessage
@HandleSocketOpen @HandleSocketMessage protected Object onOpenOrMessage(SocketSession session, DeserializingMessage message) -
onPong
-
trySchedulePing
protected void trySchedulePing() -
sendPing
-
onClose
-
abort
protected void abort(int closeCode) -
isOpen
protected boolean isOpen() -
unwrap
-