Package org.axonframework.deadline
Class DeadlineDelivery
java.lang.Object
org.axonframework.deadline.DeadlineDelivery
Delivers a fired deadline to the
ScopeAware components that resolve its scope,
inside a unit of work from the configured UnitOfWorkFactory.
The registered handler interceptors run around the delivery, and both get the unit
of work's ProcessingContext, which carries the deadline message. A component that fails to handle the
deadline fails the delivery with an ExecutionException, as in Axon Framework 4, and the unit of work rolls
back.
The components are taken from the ScopeAwareProvider before the unit of work starts, so that a provider
waiting for the configuration to start does not keep a transaction open.
This class is internal, as it only serves the deadline managers of this module, which deliver fired deadlines in the same way.
- Since:
- 5.4.0
- Author:
- Jakob Hatzl
-
Constructor Summary
ConstructorsConstructorDescriptionDeadlineDelivery(UnitOfWorkFactory unitOfWorkFactory, ScopeAwareProvider scopeAwareProvider, List<MessageHandlerInterceptor<? super DeadlineMessage>> handlerInterceptors) Creates aDeadlineDeliverydelivering through the given components. -
Method Summary
Modifier and TypeMethodDescriptionvoiddeliver(DeadlineMessage deadlineMessage, ScopeDescriptor deadlineScope) Delivers the givendeadlineMessageto the components resolving the givendeadlineScope, and waits for the unit of work to complete.
-
Constructor Details
-
DeadlineDelivery
public DeadlineDelivery(UnitOfWorkFactory unitOfWorkFactory, ScopeAwareProvider scopeAwareProvider, List<MessageHandlerInterceptor<? super DeadlineMessage>> handlerInterceptors) Creates aDeadlineDeliverydelivering through the given components.- Parameters:
unitOfWorkFactory- the factory of the unit of work a fired deadline runs inscopeAwareProvider- the provider of the components that may resolve a deadline's scopehandlerInterceptors- the handler interceptors to run around the delivery, read on every delivery
-
-
Method Details
-
deliver
Delivers the givendeadlineMessageto the components resolving the givendeadlineScope, and waits for the unit of work to complete.- Parameters:
deadlineMessage- the fired deadlinedeadlineScope- the scope the deadline was scheduled for- Throws:
RuntimeException- the failure of a handler interceptor or the delivery unwrapped from the UnitOfWork, or the failure of theScopeAwareProvider
-