Class AbstractEvent
- java.lang.Object
-
- software.amazon.disco.agent.event.AbstractEvent
-
- All Implemented Interfaces:
Event
- Direct Known Subclasses:
AbstractProtocolEvent,AbstractServiceEvent,AbstractThreadEvent,AbstractTransactionEvent
public abstract class AbstractEvent extends java.lang.Object implements Event
All Events inherit from this base class. It contains a Map of data which can be inspected by Listeners
-
-
Constructor Summary
Constructors Constructor Description AbstractEvent(java.lang.String origin)Construct a new AbstractEvent
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ObjectgetData(java.lang.String key)Retrieve a data value from this event, given a named keyjava.lang.StringgetOrigin()Getter for the Event's origin.AbstractEventwithData(java.lang.String key, java.lang.Object data)Add a data item to this event with the given name and value
-
-
-
Constructor Detail
-
AbstractEvent
public AbstractEvent(java.lang.String origin)
Construct a new AbstractEvent- Parameters:
origin- a string indicating the origin of the Event such as 'Concurrency'. Designed to agree with the DiSCo support package names, and may be used for logging or decision making in Listeners.
-
-
Method Detail
-
withData
public AbstractEvent withData(java.lang.String key, java.lang.Object data)
Add a data item to this event with the given name and value- Parameters:
key- the name of this datadata- the value of this data- Returns:
- the 'this' of the Event, to allow method chaining
-
getOrigin
public java.lang.String getOrigin()
Getter for the Event's origin. This is named for the DiSCo support package name e.g. 'Web'
-
-