Interface DeadlineManager
- All Superinterfaces:
MessageDispatchInterceptorSupport<DeadlineMessage<?>>,MessageHandlerInterceptorSupport<DeadlineMessage<?>>
- All Known Implementing Classes:
AbstractDeadlineManager,DbSchedulerDeadlineManager,JobRunrDeadlineManager,QuartzDeadlineManager,SimpleDeadlineManager,StubDeadlineManager
- Since:
- 3.3
- Author:
- Milan Savic, Steven van Beelen
-
Method Summary
Modifier and TypeMethodDescriptionvoidCancels all the deadlines corresponding to the givendeadlineName.default voidcancelAllWithinScope(String deadlineName) Cancels all deadlines corresponding to the givendeadlineNamethat are scheduled withinScope.describeCurrentScope().voidcancelAllWithinScope(String deadlineName, ScopeDescriptor scope) Cancels all deadlines corresponding to the givendeadlineNameandscope.voidcancelSchedule(String deadlineName, String scheduleId) Cancels the deadline corresponding to the givendeadlineName/scheduleIdcombination.default StringSchedules a deadline after the giventriggerDurationwith givendeadlineName.default StringSchedules a deadline after the giventriggerDuration.default Stringschedule(Duration triggerDuration, String deadlineName, Object messageOrPayload, ScopeDescriptor deadlineScope) Schedules a deadline after the giventriggerDurationwith provided context.default StringSchedules a deadline at giventriggerDateTimewith givendeadlineName.default StringSchedules a deadline at giventriggerDateTimewith givendeadlineName.schedule(Instant triggerDateTime, String deadlineName, Object messageOrPayload, ScopeDescriptor deadlineScope) Schedules a deadline at giventriggerDateTimewith provided context.default voidshutdown()Shuts down this deadline manager.Methods inherited from interface org.axonframework.messaging.MessageDispatchInterceptorSupport
registerDispatchInterceptorMethods inherited from interface org.axonframework.messaging.MessageHandlerInterceptorSupport
registerHandlerInterceptor
-
Method Details
-
schedule
Schedules a deadline at giventriggerDateTimewith givendeadlineName. The payload of this deadline will benull, as none is provided. The returnedscheduleIdand provideddeadlineNamecombination can be used to cancel the scheduled deadline. The scope within which this call is made will be retrieved by the DeadlineManager itself. -
schedule
default String schedule(@Nonnull Instant triggerDateTime, @Nonnull String deadlineName, @Nullable Object messageOrPayload) Schedules a deadline at giventriggerDateTimewith givendeadlineName. The returnedscheduleIdand provideddeadlineNamecombination can be used to cancel the scheduled deadline. The scope within which this call is made will be retrieved by the DeadlineManager itself.The given
messageOrPayloadmay be any object, as well as a DeadlineMessage. In the latter case, the instance provided is the donor for the payload andMetaDataof the actual deadline being used. In the former case, the givenmessageOrPayloadwill be wrapped as the payload of aDeadlineMessage.- Parameters:
triggerDateTime- AInstantdenoting the moment to trigger the deadline handlingdeadlineName- AStringrepresenting the name of the deadline to schedulemessageOrPayload- AMessageor payload for a message as anObject- Returns:
- the
scheduleIdas aStringto use when cancelling the schedule
-
schedule
String schedule(@Nonnull Instant triggerDateTime, @Nonnull String deadlineName, @Nullable Object messageOrPayload, @Nonnull ScopeDescriptor deadlineScope) Schedules a deadline at giventriggerDateTimewith provided context. The returnedscheduleIdand provideddeadlineNamecombination can be used to cancel the scheduled deadline.The given
messageOrPayloadmay be any object, as well as a DeadlineMessage. In the latter case, the instance provided is the donor for the payload andMetaDataof the actual deadline being used. In the former case, the givenmessageOrPayloadwill be wrapped as the payload of aDeadlineMessage.- Parameters:
triggerDateTime- AInstantdenoting the moment to trigger the deadline handlingdeadlineName- AStringrepresenting the name of the deadline to schedulemessageOrPayload- AMessageor payload for a message as anObjectdeadlineScope- AScopeDescriptordescribing the scope within which the deadline was scheduled- Returns:
- the
scheduleIdas aStringto use when cancelling the schedule
-
schedule
Schedules a deadline after the giventriggerDurationwith givendeadlineName. The payload of this deadline will benull, as none is provided. The returnedscheduleIdand provideddeadlineNamecombination can be used to cancel the scheduled deadline. The scope within which this call is made will be retrieved by the DeadlineManager itself. -
schedule
default String schedule(@Nonnull Duration triggerDuration, @Nonnull String deadlineName, @Nullable Object messageOrPayload) Schedules a deadline after the giventriggerDuration. The returnedscheduleIdand provideddeadlineNamecombination can be used to cancel the scheduled deadline. The scope within which this call is made will be retrieved by the DeadlineManager itself.The given
messageOrPayloadmay be any object, as well as a DeadlineMessage. In the latter case, the instance provided is the donor for the payload andMetaDataof the actual deadline being used. In the former case, the givenmessageOrPayloadwill be wrapped as the payload of aDeadlineMessage.- Parameters:
triggerDuration- ADurationdescribing the waiting period before handling the deadlinedeadlineName- AStringrepresenting the name of the deadline to schedulemessageOrPayload- AMessageor payload for a message as anObject- Returns:
- the
scheduleIdas aStringto use when cancelling the schedule
-
schedule
default String schedule(@Nonnull Duration triggerDuration, @Nonnull String deadlineName, @Nullable Object messageOrPayload, @Nonnull ScopeDescriptor deadlineScope) Schedules a deadline after the giventriggerDurationwith provided context. The provideddeadlineName/scheduleIdcombination can be used to cancel the scheduled deadline.The given
messageOrPayloadmay be any object, as well as a DeadlineMessage. In the latter case, the instance provided is the donor for the payload andMetaDataof the actual deadline being used. In the former case, the givenmessageOrPayloadwill be wrapped as the payload of aDeadlineMessage.- Parameters:
triggerDuration- ADurationdescribing the waiting period before handling the deadlinedeadlineName- AStringrepresenting the name of the deadline to schedulemessageOrPayload- AMessageor payload for a message as anObjectdeadlineScope- AScopeDescriptordescribing the scope within which the deadline was scheduled- Returns:
- the
scheduleIdas aStringto use when cancelling the schedule
-
cancelSchedule
Cancels the deadline corresponding to the givendeadlineName/scheduleIdcombination. This method has no impact on deadlines which have already been triggered. -
cancelAll
Cancels all the deadlines corresponding to the givendeadlineName. This method has no impact on deadlines which have already been triggered.- Parameters:
deadlineName- aStringrepresenting the name of the deadlines to cancel
-
cancelAllWithinScope
Cancels all deadlines corresponding to the givendeadlineNamethat are scheduled withinScope.describeCurrentScope(). This method has no impact on deadlines which have already been triggered.- Parameters:
deadlineName- aStringrepresenting the name of the deadlines to cancel
-
cancelAllWithinScope
Cancels all deadlines corresponding to the givendeadlineNameandscope. This method has no impact on deadlines which have already been triggered.- Parameters:
deadlineName- aStringrepresenting the name of the deadlines to cancelscope- aScopeDescriptordescribing the scope within which the deadline was scheduled
-
shutdown
default void shutdown()Shuts down this deadline manager.
-