Interface MessageMonitorFactory<M extends Message>

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

This interface allows MessageMonitors to be constructed with knowledge of the component they will monitor, allowing for fine-grained control on how or when to construct an interceptor. This, for example, enables proper tagging and categorization in metric systems.

Since:
5.0.3
Author:
Steven van Beelen
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable MessageMonitor<? super M>
    build(@NonNull Configuration config, @NonNull Class<?> componentType, @Nullable String componentName)
    Builds a MessageMonitor for the specified component.
  • Method Details

    • build

      @Nullable MessageMonitor<? super M> build(@NonNull Configuration config, @NonNull Class<?> componentType, @Nullable String componentName)
      Builds a MessageMonitor 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 monitor for
      componentName - the name of the component to build a monitor for
      Returns:
      a MessageMonitor instance configured for the specified component or null when no monitor is required for the given componentType and componentName combination