Class SocketEndpointHandler

java.lang.Object
io.fluxcapacitor.javaclient.web.SocketEndpointHandler
All Implemented Interfaces:
Handler<DeserializingMessage>

public class SocketEndpointHandler extends Object implements Handler<DeserializingMessage>
A specialized Handler that manages lifecycle events and message dispatching for WebSocket endpoints annotated with SocketEndpoint.

This handler supports:

  • Instantiating and caching per-session WebSocket handler instances
  • Delegating to the correct handler method (e.g., @HandleSocketOpen, @HandleSocketMessage, @HandleSocketPong, @HandleSocketClose)
  • Managing handler lifecycle via SocketEndpointHandler.SocketEndpointWrapper, including automatic cleanup and ping-based connection health checks

When a DeserializingMessage is received, the handler checks whether it represents a WebSocket request. If so, it resolves or initializes a SocketEndpointHandler.SocketEndpointWrapper associated with the given session ID and delegates message handling to the appropriate method. For non-WebSocket messages, the handler behaves like a typical Handler by invoking any matching method on the target class or on cached wrappers.

This class is primarily intended for internal use by the Flux dispatcher infrastructure.

See Also: