public interface DeadlineManager extends MessageDispatchInterceptorSupport<DeadlineMessage<?>>, MessageHandlerInterceptorSupport<DeadlineMessage<?>>
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 |
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 . |
String |
schedule(Duration triggerDuration,
String deadlineName,
Object messageOrPayload,
ScopeDescriptor deadlineScope)
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. |
registerDispatchInterceptor
registerHandlerInterceptor
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
Object
scheduleId
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
Object
deadlineScope
- A ScopeDescriptor
describing the scope within which the deadline was scheduledscheduleId
as a String
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
Object
scheduleId
as a String
to use when cancelling the scheduleString schedule(Duration triggerDuration, String deadlineName, Object messageOrPayload, ScopeDescriptor deadlineScope)
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
Object
deadlineScope
- A ScopeDescriptor
describing the scope within which the deadline was scheduledvoid 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.