Overview of contexts in Java applications
The Apama Java API provides the com.apama.jmon.Context data type. This class corresponds to the EPL context data type, but with a more limited set of features:
![*](bullet1.png)
A Java event definiton can contain a
Context type field. This lets you transfer a reference to a context to and from an Apama Java application. You cannot pass context references between the correlator and your Apama Java application on their own.
![*](bullet1.png)
You can enqueue events to
![*](bullet2.png)
Particular contexts:
Event.enqueueTo(Context c)![*](bullet2.png)
A list or array of contexts:
Event.enqueueTo(java.util.List<Context> ctxList)
Event.enqueueTo(Context[] ctxList)
![*](bullet1.png)
You can call
Context.getCurrent() to obtain a reference to the context that a piece of code is running in.
![*](bullet1.png)
The
Context class provides accessor methods for context properties such as context name and context ID.
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.