Class ValidatingInterceptor
java.lang.Object
io.fluxcapacitor.javaclient.tracking.handling.validation.ValidatingInterceptor
- All Implemented Interfaces:
HandlerDecorator
,HandlerInterceptor
A
HandlerInterceptor
that validates the payload of messages before they are handled.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.fluxcapacitor.javaclient.tracking.handling.HandlerDecorator
HandlerDecorator.MergedDecorator
Nested classes/interfaces inherited from interface io.fluxcapacitor.javaclient.tracking.handling.HandlerInterceptor
HandlerInterceptor.InterceptedHandler
-
Field Summary
Fields inherited from interface io.fluxcapacitor.javaclient.tracking.handling.HandlerDecorator
noOp
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioninterceptHandling
(Function<DeserializingMessage, Object> function, HandlerInvoker invoker) Intercepts the message handling logic.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.fluxcapacitor.javaclient.tracking.handling.HandlerDecorator
andThen
Methods inherited from interface io.fluxcapacitor.javaclient.tracking.handling.HandlerInterceptor
wrap
-
Constructor Details
-
ValidatingInterceptor
public ValidatingInterceptor()
-
-
Method Details
-
interceptHandling
public Function<DeserializingMessage,Object> interceptHandling(Function<DeserializingMessage, Object> function, HandlerInvoker invoker) Description copied from interface:HandlerInterceptor
Intercepts the message handling logic.The
function
parameter represents the next step in the handling chain— typically the actual message handler. Theinvoker
provides metadata and invocation logic for the underlying handler method.Within this method, an interceptor may:
- Modify the
DeserializingMessage
before passing it to the handler - Bypass the handler entirely and return a value directly
- Wrap the result after the handler is invoked
Note: Interceptors may return a different
DeserializingMessage
, but it must be compatible with a handler method in the same target class. If no suitable handler is found, an exception will be thrown.- Specified by:
interceptHandling
in interfaceHandlerInterceptor
- Parameters:
function
- the next step in the handler chain (typically the handler itself)invoker
- the metadata and execution strategy for the actual handler method- Returns:
- a decorated function that wraps handling behavior
- Modify the
-