Package org.axonframework.messaging.core
Interface ApplicationContext
- All Known Subinterfaces:
ProcessingContext
- All Known Implementing Classes:
ConfigurationApplicationContext,EmptyApplicationContext,LegacyMessageSupportingContext,ResourceOverridingProcessingContext
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
An
ApplicationContext is a container for components that are registered in the
ComponentRegistry of the
ApplicationConfigurer. It allows retrieval of components by their type and
optionally by their name.
This interface is typically used to retrieve components that are registered in the
ApplicationConfigurer's
ComponentRegistry. It is designed to be used in places where you have access
to the ProcessingContext.
- Since:
- 5.0.0
- Author:
- Mateusz Nowak, Mitchell Herrijgers, Steven van Beelen
-
Method Summary
Modifier and TypeMethodDescriptiondefault <C> CReturns the component declared under the giventypeor throws aComponentNotFoundExceptionif it does not exist.<C> CReturns the component declared under the giventypeandnameor throws aComponentNotFoundExceptionif it does not exist.
-
Method Details
-
component
Returns the component declared under the giventypeor throws aComponentNotFoundExceptionif it does not exist.- 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.
- Throws:
ComponentNotFoundException- Whenever there is no component present for the giventype.
-
component
Returns the component declared under the giventypeandnameor throws aComponentNotFoundExceptionif it does not exist.- 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. Usenullwhen there is no name or usecomponent(Class)instead.- Returns:
- The component registered for the given
typeandname. - Throws:
ComponentNotFoundException- Whenever there is no component present for the giventypeandname.
-