public class StubEventScheduler extends Object implements org.axonframework.eventhandling.scheduling.EventScheduler
| Constructor and Description |
|---|
StubEventScheduler()
Creates an instance of the StubScheduler that uses the current date time as its conceptual "current time".
|
StubEventScheduler(java.time.temporal.TemporalAccessor currentDateTime)
Creates an instance of the StubScheduler that uses the given
currentDateTime as its conceptual
"current time". |
| Modifier and Type | Method and Description |
|---|---|
void |
advanceTime(java.time.Duration duration,
EventConsumer<org.axonframework.eventhandling.EventMessage<?>> eventConsumer)
Advance time by the given
duration and invokes the given eventConsumer for each
event scheduled for publication until that time. |
void |
advanceTime(java.time.ZonedDateTime newDateTime,
EventConsumer<org.axonframework.eventhandling.EventMessage<?>> eventConsumer)
Advance time to the given
newDateTime and invokes the given eventConsumer for each
event scheduled for publication until that time. |
org.axonframework.eventhandling.EventMessage |
advanceToNextTrigger()
Advances the "current time" of the scheduler to the next scheduled Event, and returns that event.
|
void |
cancelSchedule(org.axonframework.eventhandling.scheduling.ScheduleToken scheduleToken) |
java.time.ZonedDateTime |
getCurrentDateTime()
Returns the "Current Date Time" as used by the scheduler.
|
List<ScheduledItem> |
getScheduledItems()
Returns a view of all the scheduled Events at the time this method is called.
|
org.axonframework.eventhandling.scheduling.ScheduleToken |
schedule(java.time.Duration triggerDuration,
Object event) |
org.axonframework.eventhandling.scheduling.ScheduleToken |
schedule(java.time.ZonedDateTime triggerDateTime,
Object event) |
public StubEventScheduler()
public StubEventScheduler(java.time.temporal.TemporalAccessor currentDateTime)
currentDateTime as its conceptual
"current time".currentDateTime - The instant to use as current Date and Timepublic org.axonframework.eventhandling.scheduling.ScheduleToken schedule(java.time.ZonedDateTime triggerDateTime,
Object event)
schedule in interface org.axonframework.eventhandling.scheduling.EventSchedulerpublic org.axonframework.eventhandling.scheduling.ScheduleToken schedule(java.time.Duration triggerDuration,
Object event)
schedule in interface org.axonframework.eventhandling.scheduling.EventSchedulerpublic void cancelSchedule(org.axonframework.eventhandling.scheduling.ScheduleToken scheduleToken)
cancelSchedule in interface org.axonframework.eventhandling.scheduling.EventSchedulerpublic List<ScheduledItem> getScheduledItems()
public java.time.ZonedDateTime getCurrentDateTime()
public org.axonframework.eventhandling.EventMessage advanceToNextTrigger()
public void advanceTime(java.time.ZonedDateTime newDateTime,
EventConsumer<org.axonframework.eventhandling.EventMessage<?>> eventConsumer)
throws Exception
newDateTime and invokes the given eventConsumer for each
event scheduled for publication until that time.newDateTime - The time to advance the "current time" of the scheduler toeventConsumer - The function to invoke for each event to triggerExceptionpublic void advanceTime(java.time.Duration duration,
EventConsumer<org.axonframework.eventhandling.EventMessage<?>> eventConsumer)
throws Exception
duration and invokes the given eventConsumer for each
event scheduled for publication until that time.duration - The amount of time to advance the "current time" of the scheduler witheventConsumer - The function to invoke for each event to triggerExceptionCopyright © 2010-2016. All Rights Reserved.