Package com.pnfsoftware.jeb.util.events
Class Event
java.lang.Object
com.pnfsoftware.jeb.util.events.Event
- All Implemented Interfaces:
IEvent
Simple implementation of an event.
-
Field Details
-
ccnt
-
-
Constructor Details
-
Event
public Event()Create an event with type 0 and no data. -
Event
public Event(int type) Create an event with no data.- Parameters:
type- event type
-
Event
Create an event.- Parameters:
type- event typedata- optional event payload
-
Event
Create an event with an explicit source.- Parameters:
type- event typedata- optional event payloadsource- event source
-
-
Method Details
-
getSource
Get the source that emitted this event. -
getType
Get the event type. -
getData
Get the event payload. -
getTimestamp
public long getTimestamp()Get the event creation timestamp.- Specified by:
getTimestampin interfaceIEvent- Returns:
- epoch-relative timestamp in milliseconds
-
shouldStopPropagation
public boolean shouldStopPropagation()Determine whether propagation should stop.- Specified by:
shouldStopPropagationin interfaceIEvent- Returns:
- true if the event should not be propagated to additional listeners
-