Class EmptyApplicationContext

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

@Internal public class EmptyApplicationContext extends Object implements ApplicationContext
An ApplicationContext implementation that does not provide any components.

It is useful as a placeholder in tests, but you should never use it if you want to be able to retrieve components from the ProcessingContext in your components.

Since:
5.0.0
Author:
Mateusz Nowak
  • Field Details

    • INSTANCE

      public static final EmptyApplicationContext INSTANCE
      Returns the singleton instance of the empty application context.
  • 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.