public class QuartzDeadlineManager extends AbstractDeadlineManager
DeadlineManager that delegates scheduling and triggering to a Quartz Scheduler.| Modifier and Type | Class and Description |
|---|---|
static class |
QuartzDeadlineManager.Builder
Builder class to instantiate a
QuartzDeadlineManager. |
| Modifier | Constructor and Description |
|---|---|
protected |
QuartzDeadlineManager(QuartzDeadlineManager.Builder builder)
Instantiate a
QuartzDeadlineManager based on the fields contained in the QuartzDeadlineManager.Builder. |
| Modifier and Type | Method and Description |
|---|---|
static QuartzDeadlineManager.Builder |
builder()
Instantiate a Builder to be able to create a
QuartzDeadlineManager. |
void |
cancelAll(String deadlineName)
Cancels all the deadlines corresponding to the given
deadlineName. |
void |
cancelSchedule(String deadlineName,
String scheduleId)
Cancels the deadline corresponding to the given
deadlineName / scheduleId combination. |
String |
schedule(Duration triggerDuration,
String deadlineName,
Object messageOrPayload,
ScopeDescriptor deadlineScope)
Schedules a deadline after the given
triggerDuration with provided context. |
String |
schedule(Instant triggerDateTime,
String deadlineName,
Object messageOrPayload,
ScopeDescriptor deadlineScope)
Schedules a deadline at given
triggerDateTime with provided context. |
dispatchInterceptors, handlerInterceptors, processDispatchInterceptors, registerDispatchInterceptor, registerHandlerInterceptor, runOnPrepareCommitOrNowclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitschedule, schedule, schedule, scheduleprotected QuartzDeadlineManager(QuartzDeadlineManager.Builder builder)
QuartzDeadlineManager based on the fields contained in the QuartzDeadlineManager.Builder.
Will assert that the Scheduler, ScopeAwareProvider, TransactionManager and
Serializer are not null, and will throw an AxonConfigurationException if any of them is
null.
The TransactionManager, ScopeAwareProvider and Serializer will be tied to the Scheduler's context. If this
initialization step fails, this will too result in an AxonConfigurationException.
builder - the QuartzDeadlineManager.Builder used to instantiate a QuartzDeadlineManager instancepublic static QuartzDeadlineManager.Builder builder()
QuartzDeadlineManager.
The TransactionManager is defaulted to an NoTransactionManager, and the Serializer to a
XStreamSerializer. The Scheduler and ScopeAwareProvider are hard requirements and
as such should be provided.
QuartzDeadlineManagerpublic String schedule(Instant triggerDateTime, String deadlineName, Object messageOrPayload, ScopeDescriptor deadlineScope)
DeadlineManagertriggerDateTime with provided context. The returned scheduleId and
provided deadlineName combination can be used to cancel the scheduled deadline.
The given messageOrPayload may be any object, as well as a DeadlineMessage. In the latter case, the
instance provided is the donor for the payload and MetaData of the actual
deadline being used. In the former case, the given messageOrPayload will be wrapped as the payload of a
DeadlineMessage.
triggerDateTime - A Instant denoting the moment to trigger the deadline handlingdeadlineName - A String representing the name of the deadline to schedulemessageOrPayload - A Message or payload for a message as an
ObjectdeadlineScope - A ScopeDescriptor describing the scope within which the deadline was scheduledscheduleId as a String to use when cancelling the schedulepublic String schedule(Duration triggerDuration, String deadlineName, Object messageOrPayload, ScopeDescriptor deadlineScope)
DeadlineManagertriggerDuration with provided context. The provided
deadlineName / scheduleId combination can be used to cancel the scheduled deadline.
The given messageOrPayload may be any object, as well as a DeadlineMessage. In the latter case, the
instance provided is the donor for the payload and MetaData of the actual
deadline being used. In the former case, the given messageOrPayload will be wrapped as the payload of a
DeadlineMessage.
Scheduling a deadline with the same deadlineName and scheduleId will replace the previous
schedule with the new one.
triggerDuration - A Duration describing the waiting period before handling the deadlinedeadlineName - A String representing the name of the deadline to schedulemessageOrPayload - A Message or payload for a message as an
ObjectdeadlineScope - A ScopeDescriptor describing the scope within which the deadline was scheduledpublic void cancelSchedule(String deadlineName, String scheduleId)
DeadlineManagerdeadlineName / scheduleId combination.
This method has no impact on deadlines which have already been triggered.public void cancelAll(String deadlineName)
DeadlineManagerdeadlineName.
This method has no impact on deadlines which have already been triggered.deadlineName - A String representing the name of the deadlines to cancelCopyright © 2010–2019. All rights reserved.