Extended example of a JMon event type
Let us now consider an extended example:
package test.jmon.example;
import java.util.Map;
import com.apama.jmon.*;
/*
* TestEvent.java
*
* Class to abstract an Apama event whose primary purpose is to
* showcase how to define an event class containing parameters of
* all the allowed types, including arrays and Maps.
*/
public class TestEvent extends Event {
// example of parameters of the basic types
public long primitiveInteger;
public double primitiveFloat;
public boolean primitiveBoolean;
public String referenceString;
// example of parameters consisting of arrays of the basic types
public long[] sequenceInteger;
public double[] sequenceFloat;
public boolean[] sequenceBoolean;
public String[] sequenceString;
// a nested event of type EmbeddedTestEvent
public EmbeddedTestEvent referenceNestedTestEvent;
// a parameter of type Location
public Location referenceLocation;
// a parameter of type Map
public Map<long, String> dictionaryIntegerString;
. . .
}