org.axonframework.eventhandling.scheduling
Interface EventScheduler

All Known Implementing Classes:
QuartzEventScheduler, SimpleEventScheduler

public interface EventScheduler

Interface towards a mechanism capable of scheduling the publication of events. The accuracy of the publication time depends on the exact implementation used.

Since:
0.7
Author:
Allard Buijze

Method Summary
 void cancelSchedule(ScheduleToken scheduleToken)
          Cancel the publication of a scheduled event.
 ScheduleToken schedule(org.joda.time.DateTime triggerDateTime, ApplicationEvent event)
          Schedule the given event for publication at the given triggerDateTime.
 ScheduleToken schedule(org.joda.time.Duration triggerDuration, ApplicationEvent event)
          Schedule the given event for publication after the given triggerDuration.
 ScheduleToken schedule(ScheduledEvent event)
          Schedules the given event for publication.
 

Method Detail

schedule

ScheduleToken schedule(org.joda.time.DateTime triggerDateTime,
                       ApplicationEvent event)
Schedule the given event for publication at the given triggerDateTime. The returned ScheduleToken can be used to cancel the planned publication.

Parameters:
triggerDateTime - The moment to trigger publication of the event
event - The event to publish
Returns:
the token to use when cancelling the schedule

schedule

ScheduleToken schedule(org.joda.time.Duration triggerDuration,
                       ApplicationEvent event)
Schedule the given event for publication after the given triggerDuration. The returned ScheduleToken can be used to cancel the planned publication.

Parameters:
triggerDuration - The amount of time to wait before publishing the event
event - The event to publish
Returns:
the token to use when cancelling the schedule

schedule

ScheduleToken schedule(ScheduledEvent event)
Schedules the given event for publication. The event contains the time at which it should be published. The returned ScheduleToken can be used to cancel the planned publication.

Parameters:
event - The event to publish
Returns:
the token to use when cancelling the schedule

cancelSchedule

void cancelSchedule(ScheduleToken scheduleToken)
Cancel the publication of a scheduled event. If the events has already been published, this method does nothing.

Parameters:
scheduleToken - the token returned when the event was scheduled
Throws:
IllegalArgumentException - if the token belongs to another scheduler


Copyright © 2011. All Rights Reserved.