java.lang.Object
io.fluxzero.sdk.web.SocketEndpointHandler
- All Implemented Interfaces:
io.fluxzero.common.handling.Handler<DeserializingMessage>
public class SocketEndpointHandler
extends Object
implements io.fluxzero.common.handling.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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA stateful wrapper around a WebSocket endpoint instance, managing per-session behavior and message handling.Nested classes/interfaces inherited from interface io.fluxzero.common.handling.Handler
io.fluxzero.common.handling.Handler.DelegatingHandler<M> -
Constructor Summary
ConstructorsConstructorDescriptionSocketEndpointHandler(Class<?> targetClass, io.fluxzero.common.handling.HandlerMatcher<Object, DeserializingMessage> targetMatcher, io.fluxzero.common.handling.HandlerMatcher<Object, DeserializingMessage> wrapperMatcher, RepositoryProvider repositoryProvider) -
Method Summary
Modifier and TypeMethodDescriptionOptional<io.fluxzero.common.handling.HandlerInvoker> getInvoker(DeserializingMessage message) toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.fluxzero.common.handling.Handler
getTargetClass, or
-
Constructor Details
-
SocketEndpointHandler
public SocketEndpointHandler(Class<?> targetClass, io.fluxzero.common.handling.HandlerMatcher<Object, DeserializingMessage> targetMatcher, io.fluxzero.common.handling.HandlerMatcher<Object, DeserializingMessage> wrapperMatcher, RepositoryProvider repositoryProvider)
-
-
Method Details
-
getInvoker
public Optional<io.fluxzero.common.handling.HandlerInvoker> getInvoker(DeserializingMessage message) - Specified by:
getInvokerin interfaceio.fluxzero.common.handling.Handler<DeserializingMessage>
-
toString
-