Debugging Apama Java Applications
This section describes practical information for developing and debugging Java applications with Apama Studio. General knowledge of Java and Apama application development is assumed.
Apama Studio is built on the Eclipse IDE framework and as such running and debugging Java applications for the Apama correlator engine is no more different than with any standard Java application. There are however a few things to consider:
Single thread — For Java applications, the correlator uses a single thread of execution. When programming in Java consider the importance of maintaining determinism by not routing, emitting, or enqueueing an event in a thread other than the current thread. Java provides no guarantee on execution order for separate threads, so try to keep your Apama Java applications single threaded at all times. Although multiple threads are currently allowed for Apama Java applications, this might change in the future, with the correlator JVM issuing a warning or possibly an error.
Event definitions — To instantiate event definitions in your Apama Java application, the
Event subclass in question needs to be defined and included in your
JAR file. This is because the correlator uses a separate classloader for each application (that is, each Apama Java
JAR file injected) and hence cannot share the event definitions across separate Apama Java applications. Also, an Apama Java application cannot make use of any event definition already present in the correlator. Any event definition (either a subclass of the Java
Event class or a definition in an EPL file) must be replicated for each Apama Java application and for your injected EPL files.
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.