Extended example of a Java 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;
. . .
}
Copyright © 2013
Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or Terracotta Inc., San Francisco, CA, USA, and/or Software AG (Canada) Inc., Cambridge, Ontario, Canada, and/or, Software AG (UK) Ltd., Derby, United Kingdom, and/or Software A.G. (Israel) Ltd., Or-Yehuda, Israel and/or their licensors.