Class ClasspathHandlerDefinition

java.lang.Object
org.axonframework.messaging.core.annotation.ClasspathHandlerDefinition

public final class ClasspathHandlerDefinition extends Object
HandlerDefinition instance that locates other HandlerDefinition instances on the class path. It uses the ServiceLoader mechanism to locate and initialize them.

This means for this class to find implementations, their fully qualified class name has to be put into a file called META-INF/services/org.axonframework.messaging.core.annotation.HandlerDefinition. For more details, see ServiceLoader.

Since:
3.3.0
Author:
Tyler Thrailkill, Milan Savic
See Also:
  • Method Details

    • forClass

      public static MultiHandlerDefinition forClass(Class<?> clazz)
      Creates an instance for the given clazz. Effectively, the class loader of the given class is used to locate implementations.
      Parameters:
      clazz - The class for which the handler definition must be returned
      Returns:
      a MultiHandlerDefinition that can create handlers for the given class
    • forClassLoader

      public static MultiHandlerDefinition forClassLoader(ClassLoader classLoader)
      Creates an instance using the given classLoader. Implementations are located using this class loader.
      Parameters:
      classLoader - The class loader to locate the implementations with
      Returns:
      a MultiHandlerDefinition instance using the given classLoader