/** * Configures the builder function to create the Message Monitor for the Message processing components in this * configuration that match the given componentType, unless more specific configuration based on both type and name * is available. * <p> * <p>A component matches componentType if componentType is assignable from the component's class. If a component * matches multiple types, and the types derive from each other, the configuration from the most derived type is * used. If the matching types do not derive from each other, the result is unspecified.</p> * <p> * <p>For example: in case a monitor is configured for {@link CommandBus} and another monitor is configured for * {@link org.axonframework.commandhandling.SimpleCommandBus SimpleCommandBus}), components of type * {@link org.axonframework.commandhandling.AsynchronousCommandBus AsynchronousCommandBus} will use the monitor * configured for the SimpleCommandBus.</p> * <p> * <p>A component's name matches componentName if they are identical; i.e. they are compared case sensitively.</p> * * @param componentType The declared type of the component * @param messageMonitorBuilder The builder function to use * @return the current instance of the Configurer, for chaining purposes */ default Configurer configureMessageMonitor(Class<?> componentType, Function<Configuration, MessageMonitor<Message<?>>> messageMonitorBuilder) { return configureMessageMonitor(componentType, (configuration, type, name) -> messageMonitorBuilder.apply(configuration)); }
/** * Configures the builder function to create the Message Monitor for the Message processing components in this * configuration that match the given class and name. * <p> * <p>A component matches componentType if componentType is assignable from the component's class. If a component * matches multiple types, and the types derive from each other, the configuration from the most derived type is * used. If the matching types do not derive from each other, the result is unspecified.</p> * <p> * <p>For example: in case a monitor is configured for {@link CommandBus} and another monitor is configured for * {@link org.axonframework.commandhandling.SimpleCommandBus SimpleCommandBus}), components of type * {@link org.axonframework.commandhandling.AsynchronousCommandBus AsynchronousCommandBus} will use the monitor * configured for the SimpleCommandBus.</p> * <p> * <p>A component's name matches componentName if they are identical; i.e. they are compared case sensitively.</p> * * @param componentType The declared type of the component * @param componentName The name of the component * @param messageMonitorBuilder The builder function to use * @return the current instance of the Configurer, for chaining purposes */ default Configurer configureMessageMonitor(Class<?> componentType, String componentName, Function<Configuration, MessageMonitor<Message<?>>> messageMonitorBuilder) { return configureMessageMonitor(componentType, componentName, (configuration, type, name) -> messageMonitorBuilder.apply(configuration)); }
/** * Registers the metric registry with the given {@code configurer} via * {@link Configurer#configureMessageMonitor(Function)}. * Components registered by the configurer will be added by invocation of {@link #registerComponent(Class, String)}. * * @param configurer the application's configurer * @return configurer with the new registration applied */ @SuppressWarnings("unchecked") public Configurer registerWithConfigurer(Configurer configurer) { return configurer.configureMessageMonitor( configuration -> (componentType, componentName) -> (MessageMonitor<Message<?>>) registerComponent( componentType, componentName)); }
/** * Configures the builder function to create the Message Monitor for the Message processing components in this * configuration that match the given class and name. * <p> * <p>A component matches componentType if componentType is assignable from the component's class. If a component * matches multiple types, and the types derive from each other, the configuration from the most derived type is * used. If the matching types do not derive from each other, the result is unspecified.</p> * <p> * <p>For example: in case a monitor is configured for {@link CommandBus} and another monitor is configured for * {@link org.axonframework.commandhandling.SimpleCommandBus SimpleCommandBus}), components of type * {@link org.axonframework.commandhandling.AsynchronousCommandBus AsynchronousCommandBus} will use the monitor * configured for the SimpleCommandBus.</p> * <p> * <p>A component's name matches componentName if they are identical; i.e. they are compared case sensitively.</p> * * @param componentType The declared type of the component * @param componentName The name of the component * @param messageMonitorBuilder The builder function to use * @return the current instance of the Configurer, for chaining purposes */ default Configurer configureMessageMonitor(Class<?> componentType, String componentName, Function<Configuration, MessageMonitor<Message<?>>> messageMonitorBuilder) { return configureMessageMonitor(componentType, componentName, (configuration, type, name) -> messageMonitorBuilder.apply(configuration)); }
/** * Configures the builder function to create the Message Monitor for the Message processing components in this * configuration that match the given componentType, unless more specific configuration based on both type and name * is available. * <p> * <p>A component matches componentType if componentType is assignable from the component's class. If a component * matches multiple types, and the types derive from each other, the configuration from the most derived type is * used. If the matching types do not derive from each other, the result is unspecified.</p> * <p> * <p>For example: in case a monitor is configured for {@link CommandBus} and another monitor is configured for * {@link org.axonframework.commandhandling.SimpleCommandBus SimpleCommandBus}), components of type * {@link org.axonframework.commandhandling.AsynchronousCommandBus AsynchronousCommandBus} will use the monitor * configured for the SimpleCommandBus.</p> * <p> * <p>A component's name matches componentName if they are identical; i.e. they are compared case sensitively.</p> * * @param componentType The declared type of the component * @param messageMonitorBuilder The builder function to use * @return the current instance of the Configurer, for chaining purposes */ default Configurer configureMessageMonitor(Class<?> componentType, Function<Configuration, MessageMonitor<Message<?>>> messageMonitorBuilder) { return configureMessageMonitor(componentType, (configuration, type, name) -> messageMonitorBuilder.apply(configuration)); }
/** * Configures the builder function to create the Message Monitor for the Message processing components in this * configuration that match the given componentType, unless more specific configuration based on both type and name * is available. * <p> * <p>A component matches componentType if componentType is assignable from the component's class. If a component * matches multiple types, and the types derive from each other, the configuration from the most derived type is * used. If the matching types do not derive from each other, the result is unspecified.</p> * <p> * <p>For example: in case a monitor is configured for {@link CommandBus} and another monitor is configured for * {@link org.axonframework.commandhandling.SimpleCommandBus SimpleCommandBus}), components of type * {@link org.axonframework.commandhandling.AsynchronousCommandBus AsynchronousCommandBus} will use the monitor * configured for the SimpleCommandBus.</p> * <p> * <p>A component's name matches componentName if they are identical; i.e. they are compared case sensitively.</p> * * @param componentType The declared type of the component * @param messageMonitorBuilder The builder function to use * @return the current instance of the Configurer, for chaining purposes */ default Configurer configureMessageMonitor(Class<?> componentType, Function<Configuration, MessageMonitor<Message<?>>> messageMonitorBuilder) { return configureMessageMonitor(componentType, (configuration, type, name) -> messageMonitorBuilder.apply(configuration)); }
/** * Configures the builder function to create the Message Monitor for the Message processing components in this * configuration that match the given class and name. * <p> * <p>A component matches componentType if componentType is assignable from the component's class. If a component * matches multiple types, and the types derive from each other, the configuration from the most derived type is * used. If the matching types do not derive from each other, the result is unspecified.</p> * <p> * <p>For example: in case a monitor is configured for {@link CommandBus} and another monitor is configured for * {@link org.axonframework.commandhandling.SimpleCommandBus SimpleCommandBus}), components of type * {@link org.axonframework.commandhandling.AsynchronousCommandBus AsynchronousCommandBus} will use the monitor * configured for the SimpleCommandBus.</p> * <p> * <p>A component's name matches componentName if they are identical; i.e. they are compared case sensitively.</p> * * @param componentType The declared type of the component * @param componentName The name of the component * @param messageMonitorBuilder The builder function to use * @return the current instance of the Configurer, for chaining purposes */ default Configurer configureMessageMonitor(Class<?> componentType, String componentName, Function<Configuration, MessageMonitor<Message<?>>> messageMonitorBuilder) { return configureMessageMonitor(componentType, componentName, (configuration, type, name) -> messageMonitorBuilder.apply(configuration)); }
/** * Registers the metric registry with the given {@code configurer} via * {@link Configurer#configureMessageMonitor(Function)}. * Components registered by the configurer will be added by invocation of {@link #registerComponent(Class, String)}. * * @param configurer the application's configurer * @return configurer with the new registration applied */ @SuppressWarnings("unchecked") public Configurer registerWithConfigurer(Configurer configurer) { return configurer.configureMessageMonitor( configuration -> (componentType, componentName) -> (MessageMonitor<Message<?>>) registerComponent( componentType, componentName)); }