Class MessageHandlerLookup

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

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 Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static List<String>
    messageHandlerBeans(Class<? extends org.axonframework.messaging.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.
    static List<String>
    messageHandlerBeans(Class<? extends org.axonframework.messaging.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.
    void
    postProcessBeanDefinitionRegistry(org.springframework.beans.factory.support.BeanDefinitionRegistry registry)
     
    void
    postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MessageHandlerLookup

      public MessageHandlerLookup()
  • Method Details

    • messageHandlerBeans

      public static List<String> messageHandlerBeans(Class<? extends org.axonframework.messaging.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 org.axonframework.messaging.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.
      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.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