public interface DeadlineManager
scheduleId and ones which generate and return the id themselves. For callers that want to use the auto
generated schedule id approach, it is recommended to use generateScheduleId() method.| Modifier and Type | Method and Description |
|---|---|
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. |
default String |
generateScheduleId()
Generates a
String schedule id. |
default String |
schedule(Duration triggerDuration,
String deadlineName)
Schedules a deadline after the given
triggerDuration with given deadlineName. |
default String |
schedule(Duration triggerDuration,
String deadlineName,
Object messageOrPayload)
Schedules a deadline after the given
triggerDuration. |
default String |
schedule(Duration triggerDuration,
String deadlineName,
Object messageOrPayload,
ScopeDescriptor deadlineScope)
Schedules a deadline after the given
triggerDuration with provided context. |
void |
schedule(Duration triggerDuration,
String deadlineName,
Object messageOrPayload,
ScopeDescriptor deadlineScope,
String scheduleId)
Schedules a deadline after the given
triggerDuration with provided context. |
default String |
schedule(Instant triggerDateTime,
String deadlineName)
Schedules a deadline at given
triggerDateTime with given deadlineName. |
default String |
schedule(Instant triggerDateTime,
String deadlineName,
Object messageOrPayload)
Schedules a deadline at given
triggerDateTime with given deadlineName. |
default String |
schedule(Instant triggerDateTime,
String deadlineName,
Object messageOrPayload,
ScopeDescriptor deadlineScope)
Schedules a deadline at given
triggerDateTime with provided context. |
default void |
schedule(Instant triggerDateTime,
String deadlineName,
Object messageOrPayload,
ScopeDescriptor deadlineScope,
String scheduleId)
Schedules a deadline at given
triggerDateTime with provided context. |
default String schedule(Instant triggerDateTime, String deadlineName)
triggerDateTime with given deadlineName. The payload of this
deadline will be null, as none is provided. The returned scheduleId and provided
deadlineName combination can be used to cancel the scheduled deadline. The scope within which this call
is made will be retrieved by the DeadlineManager itself.default String schedule(Instant triggerDateTime, String deadlineName, Object messageOrPayload)
triggerDateTime with given deadlineName. The returned
scheduleId and provided deadlineName combination 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 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
ObjectscheduleId as a String to use when cancelling the scheduledefault String schedule(Instant triggerDateTime, String deadlineName, Object messageOrPayload, ScopeDescriptor deadlineScope)
triggerDateTime 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 scheduledefault void schedule(Instant triggerDateTime, String deadlineName, Object messageOrPayload, ScopeDescriptor deadlineScope, String scheduleId)
triggerDateTime 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.
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 - A String schedule id to use when cancelling the scheduledefault String schedule(Duration triggerDuration, String deadlineName)
triggerDuration with given deadlineName. The payload of this
deadline will be null, as none is provided. The returned scheduleId and provided
deadlineName combination can be used to cancel the scheduled deadline.
The scope within which this call is made will be retrieved by the DeadlineManager itself.default String schedule(Duration triggerDuration, String deadlineName, Object messageOrPayload)
triggerDuration. The returned scheduleId and provided
deadlineName combination 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 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.
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
ObjectscheduleId as a String to use when cancelling the scheduledefault String schedule(Duration triggerDuration, String deadlineName, Object messageOrPayload, ScopeDescriptor deadlineScope)
triggerDuration 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.
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 scheduledscheduleId as a String to use when cancelling the schedulevoid schedule(Duration triggerDuration, String deadlineName, Object messageOrPayload, ScopeDescriptor deadlineScope, String scheduleId)
triggerDuration 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 scheduledscheduleId - A String schedule id to use when cancelling the scheduledefault String generateScheduleId()
String schedule id.String schedule idvoid cancelSchedule(String deadlineName, String scheduleId)
deadlineName / scheduleId combination.
This method has no impact on deadlines which have already been triggered.Copyright © 2010–2018. All rights reserved.