public abstract class Event
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable
For example, for an Apama event type definition:
the corresponding Event subclass in Java would have fields:
MyEvent {
integer i1;
sequence<float> seq1;
dictionary<string, MyEvent2> dict1;
OtherEvent other;
}
public long i1;
public double[] seq1;
public Map<String, MyEvent2> dict1;
public OtherEvent other;
Note that in the current release of Apama, the Event's constructor will automatically assign the EPL default value (0, "", empty array, new event objects) to every public field not already assigned a value by an initializer to ensure that everything is initialized to a non-null value by the time the subclass constructor is invoked. (EPL does not support null values and event instances containing them cannot be sent out of a Java application)
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone() |
void |
emit()
Emit this Event from the Engine on the default channel.
|
void |
emit(java.lang.String channel)
Emit this Event from the Engine on a specific channel.
|
void |
enqueue()
Enqueue this Event internally within the Correlator.
|
void |
enqueueTo(Context ctx)
Enqueue this event to a correlator context.
|
void |
enqueueTo(Context[] ctxArray)
Enqueue this event to an array of correlator contexts.
|
void |
enqueueTo(java.util.List<Context> ctxList)
Enqueue this event to a list of correlator contexts.
|
boolean |
equals(java.lang.Object other)
Override Object.equals() to check equality based upon
the field values of the instance.
|
int[] |
getFieldAttributes(java.lang.String fieldName)
Deprecated.
This method has been deprecated and may be removed in a future release -
Please use the new JMon annotations instead.
|
java.lang.Class[] |
getMapFieldTypes(java.lang.String fieldName)
This method should be overridden in any subclass that has fields of type
Map . |
java.lang.String |
getName()
Get the Correlator name for this Event subclass instance.
|
static java.lang.String |
getName(java.lang.Class eventSubClass)
Get the Correlator name for the specified Event subclass.
|
double |
getTime()
Get the time that the event arrived at the correlator.
|
int |
hashCode()
Override Object.hashCode() to provide a hash code that is based upon
the field values of the instance.
|
boolean |
isExternal()
Determine if this is an "external" event - if it originated outside the correlator.
|
void |
route()
Route this Event internally within the Correlator.
|
java.lang.String |
toString()
Override Object.toString() to provide output compatible with the Apama
standard representation of Event data types.
|
public java.lang.Object clone()
clone
in class java.lang.Object
public void emit()
public void emit(java.lang.String channel)
channel
- the Channel on which the Event is to be emitted from the Engine.public void route()
public void enqueue()
public void enqueueTo(Context ctx)
ctx
- the destination context where the event will be enqueued to.public void enqueueTo(Context[] ctxArray)
ctxArray
- the array of destination contexts where the event will be enqueued to.public void enqueueTo(java.util.List<Context> ctxList)
ctxList
- the list of destination contexts where the event will be enqueued to.@Deprecated public int[] getFieldAttributes(java.lang.String fieldName)
public static int[] getFieldAttributes(String fieldName) { int[] attributes = null; if (fieldName.equals("payload")) attributes = new int[]{EventFieldAttributes.WILDCARD}; return attributes; }
fieldName
- the name of the member field whose attributes are to be checked.Wildcard
public java.lang.Class[] getMapFieldTypes(java.lang.String fieldName)
Map
.
This method is required because the key and value are typed in MonitorScript dictionary container type. In MonitorScript, the key and value types are declared in syntax resembling generic or template programming. However, the standard Java language and container libraries do not yet support generics and so this light-weight mechanism has been chosen in the interim.
e.g. If a subclass has a member field with the name "myDictionary" and
that field should be treated as the correlator type
"dictionary < integer, string >", then the field should be declared
as a java.util.Map, and the getMapFieldTypes method should be overriden
as shown below:
public Class[] getMapFieldTypes(String fieldName) { Class[] types = null; if (fieldName.equals("myDictionary")) types = new Class[]{Long.TYPE, String.class}; return types; }
fieldName
- the name of the member field whose attributes are to be checked.public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
other
- The object to be compared for equality.public static java.lang.String getName(java.lang.Class eventSubClass)
eventSubClass
- This is the class for the event type for which the name is required.public java.lang.String getName()
public double getTime()
public boolean isExternal()
Submit a bug or feature
Copyright (c) 2013-2021 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors. Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Software AG.