Class BaseModule<S extends BaseModule<S>>

java.lang.Object
org.axonframework.common.configuration.BaseModule<S>
Type Parameters:
S - The type extending this module, to support fluent interfaces.
All Implemented Interfaces:
Module
Direct Known Subclasses:
PooledStreamingEventProcessorModule, SubscribingEventProcessorModule

public abstract class BaseModule<S extends BaseModule<S>> extends Object implements Module
Base implementation for custom modules that contains the ComponentRegistry required to register components, enhancers and (sub)modules.
Since:
5.0.0
Author:
Allard Buijze
  • Field Details

    • name

      protected final String name
  • Constructor Details

    • BaseModule

      protected BaseModule(@Nonnull String name)
      Construct a base module with the given name.
      Parameters:
      name - The name of this module. Must not be null.
  • Method Details

    • name

      public String name()
      Description copied from interface: Module
      The identifying name of this Module.
      Specified by:
      name in interface Module
      Returns:
      The identifying name of this Module.
    • build

      public Configuration build(@Nonnull Configuration parent, @Nonnull LifecycleRegistry lifecycleRegistry)
      Description copied from interface: Module
      Builds this Module, resulting in the Configuration containing all registered components.

      The given parent allows access to components that have been registered with it. Note that this operation is typically invoked through ApplicationConfigurer.build() and as such should not be invoked directly.

      Specified by:
      build in interface Module
      Parameters:
      parent - The parent Configuration this Module belongs in, giving it access to the parent's components.
      lifecycleRegistry - The registry where lifecycle handlers can be registered by this module.
      Returns:
      The fully initialized Configuration instance from this Module specifically.
    • postProcessConfiguration

      protected Configuration postProcessConfiguration(Configuration moduleConfiguration)
      Method that can be overridden to specify specific actions that need to be taken after the configuration for this module is constructed.

      The default implementation returns the configuration unchanged.

      Parameters:
      moduleConfiguration - The configuration for this module.
    • componentRegistry

      public S componentRegistry(@Nonnull Consumer<ComponentRegistry> registryAction)
      Executes the given registryAction on the ComponentRegistry associated with this module.
      Parameters:
      registryAction - The action to perform on the component registry.
      Returns:
      This instance for fluent interfacing.