Interface DispatchInterceptorFactory<M extends Message>

Type Parameters:
M - the type of Message the resulting MessageDispatchInterceptor will intercept
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 DispatchInterceptorFactory<M extends Message>
Functional interface for building a MessageDispatchInterceptor for a specific component type and component name.

This interface allows MessageDispatchInterceptors to be constructed with knowledge of the component they will intercept, allowing for fine-grained control on how or when to construct an interceptor.

Since:
5.0.3
Author:
Steven van Beelen
  • Method Details

    • build

      @Nullable MessageDispatchInterceptor<? super M> build(@NonNull Configuration config, @NonNull Class<?> componentType, @Nullable String componentName)
      Builds a MessageDispatchInterceptor for the specified component.
      Parameters:
      config - the Configuration from which other components can be retrieved during construction
      componentType - the type of the component to build a dispatch interceptor for
      componentName - the name of the component to build a dispatch interceptor for
      Returns:
      a MessageDispatchInterceptor instance configured for the specified component or null when no interceptor is required for the given componentType and componentName combination