Class ConfigurationApplicationContext

java.lang.Object
org.axonframework.messaging.core.ConfigurationApplicationContext
All Implemented Interfaces:
ApplicationContext

@Internal public class ConfigurationApplicationContext extends Object implements ApplicationContext
An ApplicationContext implementation that retrieves components from a given Configuration.
Since:
5.0.0
Author:
Mateusz Nowak
  • Constructor Details

    • ConfigurationApplicationContext

      public ConfigurationApplicationContext(@Nonnull Configuration configuration)
      Creates a new ConfigurationApplicationContext that retrieves components from the given configuration.
      Parameters:
      configuration - The configuration to retrieve components from.
  • Method Details

    • component

      @Nonnull public <C> C component(@Nonnull Class<C> type, @Nullable String name)
      Description copied from interface: ApplicationContext
      Returns the component declared under the given type and name or throws a ComponentNotFoundException if it does not exist.
      Specified by:
      component in interface ApplicationContext
      Type Parameters:
      C - The type of component.
      Parameters:
      type - The type of component, typically the interface the component implements.
      name - The name of the component to retrieve. Use null when there is no name or use ApplicationContext.component(Class) instead.
      Returns:
      The component registered for the given type and name.
    • component

      @Nonnull public <C> C component(@Nonnull Class<C> type)
      Description copied from interface: ApplicationContext
      Returns the component declared under the given type or throws a ComponentNotFoundException if it does not exist.
      Specified by:
      component in interface ApplicationContext
      Type Parameters:
      C - The type of component.
      Parameters:
      type - The type of component, typically the interface the component implements.
      Returns:
      The component registered for the given type.