Package org.axonframework.messaging.core
Class EmptyApplicationContext
java.lang.Object
org.axonframework.messaging.core.EmptyApplicationContext
- All Implemented Interfaces:
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final EmptyApplicationContextReturns the singleton instance of the empty application context. -
Method Summary
Modifier and TypeMethodDescription<C> CReturns the component declared under the giventypeandnameor throws aComponentNotFoundExceptionif it does not exist.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.axonframework.messaging.core.ApplicationContext
component
-
Field Details
-
INSTANCE
Returns the singleton instance of the empty application context.
-
-
Method Details
-
component
Description copied from interface:ApplicationContextReturns the component declared under the giventypeandnameor throws aComponentNotFoundExceptionif it does not exist.- Specified by:
componentin interfaceApplicationContext- 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 useApplicationContext.component(Class)instead.- Returns:
- The component registered for the given
typeandname.
-