org.axonframework.eventhandling.scheduling
Class ScheduledEvent

java.lang.Object
  extended by org.axonframework.domain.EventBase
      extended by org.axonframework.domain.ApplicationEvent
          extended by org.axonframework.eventhandling.scheduling.ScheduledEvent
All Implemented Interfaces:
Serializable, Event

public abstract class ScheduledEvent
extends ApplicationEvent

Abstract implementation of the ApplicationEvent that contains the timestamp of the moment the event is scheduled for publication.

Since:
0.7
Author:
Allard Buijze
See Also:
Serialized Form

Constructor Summary
ScheduledEvent(Object source, org.joda.time.DateTime timestamp)
          Initializes a new scheduled event, scheduled for publication at the given timestamp.
ScheduledEvent(Object source, org.joda.time.Duration duration)
          Initializes a new scheduled event, scheduled for publication after a given duration.
 
Method Summary
 org.joda.time.DateTime getScheduledTime()
          The time at which the event is to be published.
 
Methods inherited from class org.axonframework.domain.ApplicationEvent
getSource, getSourceDescription, getSourceType
 
Methods inherited from class org.axonframework.domain.EventBase
addMetaData, equals, getEventIdentifier, getEventRevision, getMetaData, getMetaDataValue, getTimestamp, hashCode, setEventRevision
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScheduledEvent

public ScheduledEvent(Object source,
                      org.joda.time.Duration duration)
Initializes a new scheduled event, scheduled for publication after a given duration.

Parameters:
source - The instance considered the source of this event
duration - The amount of time to wait before publication of the even

ScheduledEvent

public ScheduledEvent(Object source,
                      org.joda.time.DateTime timestamp)
Initializes a new scheduled event, scheduled for publication at the given timestamp.

Parameters:
source - The instance considered the source of this event
timestamp - The time at which to publish the event
Method Detail

getScheduledTime

public org.joda.time.DateTime getScheduledTime()
The time at which the event is to be published. Note that this property should be immutable. If this value changes the exact behavior is undefined.

Returns:
The time at which the event is to be published


Copyright © 2011. All Rights Reserved.