Class MessageHandlerLookup

java.lang.Object
org.axonframework.extension.spring.config.MessageHandlerLookup
All Implemented Interfaces:
org.springframework.beans.factory.config.BeanFactoryPostProcessor, org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor

@Internal public class MessageHandlerLookup extends Object implements org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor
A BeanDefinitionRegistryPostProcessor implementation that detects beans with Axon Message handlers and registers an MessageHandlerConfigurer to have these handlers registered in the Axon Configuration.
Since:
4.6.0
Author:
Allard Buijze
  • Constructor Details

    • MessageHandlerLookup

      public MessageHandlerLookup()
  • Method Details

    • messageHandlerBeans

      public static List<String> messageHandlerBeans(Class<? extends Message> messageType, org.springframework.beans.factory.config.ConfigurableListableBeanFactory registry)
      Returns a list of beans found in the given register that contain a handler for the given messageType. The search will not consider prototype beans (or any other non-singleton or abstract bean definitions).
      Parameters:
      messageType - The type of message to find handlers for.
      registry - The registry to find these handlers in.
      Returns:
      A list of bean names with message handlers.
    • messageHandlerBeans

      public static List<String> messageHandlerBeans(Class<? extends Message> messageType, org.springframework.beans.factory.config.ConfigurableListableBeanFactory registry, boolean includePrototypeBeans)
      Returns a list of beans found in the given register that contain a handler for the given messageType. The search will only consider prototype beans (or any other non-singleton or abstract bean definitions) when includePrototypeBeans is true.
      Parameters:
      messageType - The type of message to find handlers for.
      registry - The registry to find these handlers in.
      includePrototypeBeans - Whether to include prototype beans.
      Returns:
      A list of bean names with message handlers.
    • postProcessBeanFactory

      public void postProcessBeanFactory(@Nonnull org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory) throws org.springframework.beans.BeansException
      Specified by:
      postProcessBeanFactory in interface org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor
      Specified by:
      postProcessBeanFactory in interface org.springframework.beans.factory.config.BeanFactoryPostProcessor
      Throws:
      org.springframework.beans.BeansException
    • postProcessBeanDefinitionRegistry

      public void postProcessBeanDefinitionRegistry(@Nonnull org.springframework.beans.factory.support.BeanDefinitionRegistry registry) throws org.springframework.beans.BeansException
      Specified by:
      postProcessBeanDefinitionRegistry in interface org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor
      Throws:
      org.springframework.beans.BeansException