Interface MessageHandlerInterceptorChain<M extends Message>

Type Parameters:
M - The type of Message intercepted by this chain.
All Known Implementing Classes:
CommandMessageHandlerInterceptorChain, EventMessageHandlerInterceptorChain, QueryMessageHandlerInterceptorChain
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface MessageHandlerInterceptorChain<M extends Message>
An interceptor chain that manages the flow of a Message of type M through a chain of interceptors, and ultimately to a message handler.

Interceptors may continue processing via this chain by calling the proceed(Message, ProcessingContext) method. Alternatively, they can block processing by returning without calling either of these methods.

Since:
0.5.0
Author:
Allard Buijze, Simon Zambrovski
  • Method Summary

    Modifier and Type
    Method
    Description
    proceed(M message, ProcessingContext context)
    Signals this interceptor chain to continue processing the message.
  • Method Details

    • proceed

      @Nonnull MessageStream<?> proceed(@Nonnull M message, @Nonnull ProcessingContext context)
      Signals this interceptor chain to continue processing the message.
      Parameters:
      message - The message to pass down the chain.
      context - The active processing context the given message is being processed in.
      Returns:
      A MessageStream containing the result of processing the given message.