public interface EventScheduler
Modifier and Type | Method and Description |
---|---|
void |
cancelSchedule(ScheduleToken scheduleToken)
Cancel the publication of a scheduled event.
|
default ScheduleToken |
reschedule(ScheduleToken scheduleToken,
Duration triggerDuration,
Object event)
Cancel a scheduled event and schedule another in its place.
|
default ScheduleToken |
reschedule(ScheduleToken scheduleToken,
Instant instant,
Object event)
Cancel a scheduled event and schedule another in its place.
|
ScheduleToken |
schedule(Duration triggerDuration,
Object event)
Schedule the given
event for publication after the given triggerDuration . |
ScheduleToken |
schedule(Instant triggerDateTime,
Object event)
Schedule the given
event for publication at the given triggerDateTime . |
default void |
shutdown()
Shuts down this event scheduler.
|
ScheduleToken schedule(Instant triggerDateTime, Object event)
event
for publication at the given triggerDateTime
. The returned
ScheduleToken can be used to cancel the planned publication.
The given event
may be any object, as well as an EventMessage. In the latter case, the instance
provided is the donor for the payload and Meta Data of the actual message being dispatched. In the former case,
the given event
will be wrapped as the payload of an EventMessage.triggerDateTime
- The moment to trigger publication of the eventevent
- The event to publishScheduleToken schedule(Duration triggerDuration, Object event)
event
for publication after the given triggerDuration
. The
returned ScheduleToken can be used to cancel the planned publication.
The given event
may be any object, as well as an EventMessage. In the latter case, the instance
provided is the donor for the payload and Meta Data of the actual message being dispatched. In the former case,
the given event
will be wrapped as the payload of an EventMessage.triggerDuration
- The amount of time to wait before publishing the eventevent
- The event to publishvoid cancelSchedule(ScheduleToken scheduleToken)
scheduleToken
- the token returned when the event was scheduledIllegalArgumentException
- if the token belongs to another schedulerdefault ScheduleToken reschedule(ScheduleToken scheduleToken, Duration triggerDuration, Object event)
cancelSchedule(ScheduleToken)
and schedule(Duration, Object)
.scheduleToken
- the token returned when the event was scheduled, might be nulltriggerDuration
- The amount of time to wait before publishing the eventevent
- The event to publishIllegalArgumentException
- if the token belongs to another schedulerdefault ScheduleToken reschedule(ScheduleToken scheduleToken, Instant instant, Object event)
cancelSchedule(ScheduleToken)
and schedule(Duration, Object)
.scheduleToken
- the token returned when the event was scheduled, might be nullinstant
- The moment in time to wait before publishing the eventevent
- The event to publishIllegalArgumentException
- if the token belongs to another schedulerdefault void shutdown()
Copyright © 2010–2020. All rights reserved.