Class SocketEndpointHandler
java.lang.Object
io.fluxzero.sdk.web.SocketEndpointHandler
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 Fluxzero 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. -
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) Class<?> default io.fluxzero.common.handling.Handler<DeserializingMessage> or(io.fluxzero.common.handling.Handler<DeserializingMessage> arg0) toString()
-
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) -
toString
-
getTargetClass
Class<?> getTargetClass() -
or
default io.fluxzero.common.handling.Handler<DeserializingMessage> or(io.fluxzero.common.handling.Handler<DeserializingMessage> arg0)
-