public final class Event
extends java.lang.Object
implements java.io.Serializable
Event
can be used for communication between activities
. A common usage is to notify an
activity that certain data is available, or that some processing steps have been finished. The data of an event may implement
the ByteBuffers
interface, to send/receive any ByteBuffer
s it contains. Constellation will then call
the methods of this interface when needed.Constructor and Description |
---|
Event(ActivityIdentifier source,
ActivityIdentifier target,
java.lang.Object data)
Constructs an event with the specified parameters: a source, a target, and its data.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getData()
Returns the data object of this event.
|
ActivityIdentifier |
getSource()
Returns the identifier of the source activity of this event.
|
ActivityIdentifier |
getTarget()
Returns the identifier of the target activity of this event.
|
java.lang.String |
toString() |
public Event(ActivityIdentifier source, ActivityIdentifier target, java.lang.Object data)
source
- the source activity of this eventtarget
- the target activity for this eventdata
- the data of this event, may be null
java.lang.IllegalArgumentException
- when either source or target is null or otherwise an illegal activity identifier (not generated by
constellation). It is also thrown if the data is not null and not serializable.public java.lang.String toString()
toString
in class java.lang.Object
public ActivityIdentifier getSource()
public ActivityIdentifier getTarget()
public java.lang.Object getData()