Package org.axonframework.messaging
Class LegacyScopeAwareProvider
java.lang.Object
org.axonframework.messaging.LegacyScopeAwareProvider
- All Implemented Interfaces:
ScopeAwareProvider
The
ScopeAwareProvider of a configuration, providing the ScopeAware components that a fired deadline
is delivered to: the Saga managers, and the component translating an aggregate's deadline into a command.
The configuration creates this provider through the LegacyScopeAwareProviderConfigurationEnhancer, and the
components register themselves with it as the configuration builds them. Applications
do not create a provider. A deadline manager uses the configuration's provider instead: in Spring, by autowiring the
ScopeAwareProvider bean, and otherwise through the configuration:
JobRunrDeadlineManager.builder()
.scopeAwareProvider(configuration.getComponent(ScopeAwareProvider.class))
// ...
.build();
Axon Framework builds a Saga manager when the event processor handling its Saga starts. A persistent deadline manager
may fire an overdue deadline before that. Until the configuration has started its event processors, this provider
therefore waits before it provides any component, at most for the
readiness timeout. After that, it throws a
ScopeAwareProviderNotReadyException, upon which the deadline manager retries the deadline.- Since:
- 5.4.0
- Author:
- Jakob Hatzl
-
Method Summary
Modifier and TypeMethodDescriptionprovideScopeAwareStream(ScopeDescriptor scopeDescriptor) Retrieve aStreamofScopeAwarecomponents, by performing a check whether that component is able to handle aScopedescribed by aScopeDescriptor.voidregister(ScopeAware scopeAware) Registers the givenscopeAwarecomponent, so that this provider provides it to fired deadlines.
-
Method Details
-
register
Registers the givenscopeAwarecomponent, so that this provider provides it to fired deadlines.- Parameters:
scopeAware- the component to provide to fired deadlines
-
provideScopeAwareStream
Retrieve aStreamofScopeAwarecomponents, by performing a check whether that component is able to handle aScopedescribed by aScopeDescriptor.Provides every registered component once the configuration has started its event processors. Before that, it waits at most for the readiness timeout.
- Specified by:
provideScopeAwareStreamin interfaceScopeAwareProvider- Parameters:
scopeDescriptor- aScopeDescriptordescribing theScopea componentScopeAwareshould be able to handle- Returns:
- a
StreamofScopeAwarecomponents - Throws:
ScopeAwareProviderNotReadyException- if the configuration did not start within the readiness timeout, or shut down without starting
-