Interface HandlerInterceptor
- All Superinterfaces:
HandlerDecorator
- All Known Implementing Classes:
AuthenticatingInterceptor,DataProtectionInterceptor,DisableMetrics,ErrorReportingInterceptor,HandlerMonitor,SchedulingInterceptor,ValidatingInterceptor
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Mechanism that enables modification of a message before it is handled by a handler. A
HandlerInterceptor can
also be used to monitor handled messages, block message handling altogether, and/or inspect or modify the return
value of a handler.-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface io.fluxcapacitor.javaclient.tracking.handling.HandlerDecorator
HandlerDecorator.MergedDecorator -
Field Summary
Fields inherited from interface io.fluxcapacitor.javaclient.tracking.handling.HandlerDecorator
noOp -
Method Summary
Modifier and TypeMethodDescriptioninterceptHandling(Function<DeserializingMessage, Object> function, HandlerInvoker invoker) Intercepts a message before it's handled.default Handler<DeserializingMessage>wrap(Handler<DeserializingMessage> handler) Methods inherited from interface io.fluxcapacitor.javaclient.tracking.handling.HandlerDecorator
andThen
-
Method Details
-
interceptHandling
Function<DeserializingMessage,Object> interceptHandling(Function<DeserializingMessage, Object> function, HandlerInvoker invoker) Intercepts a message before it's handled. The underlying handler can be invoked using the givenfunction.Before invoking the handler it is possible to inspect or modify the message. It is also possible to block a message simply by returning a function that returns without invoking the handler.
After invoking the handler it is possible to inspect or modify the response.
The given
invokercontains information about the underlying handler. -
wrap
- Specified by:
wrapin interfaceHandlerDecorator
-