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 . |
default void |
cancelAllWithinScope(String deadlineName)
Cancels all deadlines corresponding to the given
deadlineName that are scheduled within Scope.describeCurrentScope() . |
void |
cancelAllWithinScope(String deadlineName,
ScopeDescriptor scope)
Cancels all deadlines corresponding to the given
deadlineName and scope . |
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 . |
default 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 . |
String |
schedule(Instant triggerDateTime,
String deadlineName,
Object messageOrPayload,
ScopeDescriptor deadlineScope)
Schedules a deadline at given
triggerDateTime with provided context. |
default void |
shutdown()
Shuts down this deadline manager.
|
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 scheduleString 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 scheduledefault String 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
.
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 scheduledscheduleId
as a String
to use when cancelling the schedulevoid cancelSchedule(String deadlineName, String scheduleId)
deadlineName
/ scheduleId
combination.
This method has no impact on deadlines which have already been triggered.void cancelAll(String deadlineName)
deadlineName
.
This method has no impact on deadlines which have already been triggered.deadlineName
- a String
representing the name of the deadlines to canceldefault void cancelAllWithinScope(String deadlineName)
deadlineName
that are scheduled within Scope.describeCurrentScope()
.
This method has no impact on deadlines which have already been triggered.deadlineName
- a String
representing the name of the deadlines to cancelvoid cancelAllWithinScope(String deadlineName, ScopeDescriptor scope)
deadlineName
and scope
.
This method has no impact on deadlines which have already been triggered.deadlineName
- a String
representing the name of the deadlines to cancelscope
- a ScopeDescriptor
describing the scope within which the deadline was scheduleddefault void shutdown()
Copyright © 2010–2020. All rights reserved.