Adding an EPL Plug-in written in Java
To add a new EPL plug-in written in Java to an Apama project
1. In the Project Explorer view or the Workbench Project view, right-click the name of the project where you want to add the EPL plug-in and select New > Java EPL Plugin. You can also select File > New > Other from the menu and then select Apama > Java EPL Plugin from the Select a wizard dialog. The New Apama Java EPL Plugin wizard appears.
2. In the New Apama Java EPL plug-in wizard, enter information in the following fields:
a. The Application field is the application to which you are adding the plug-in.
b. In the Plugin name field, specify the name of the new plug-in. This will become the name of the class and the Java file.
Important:
When importing the plug-in from EPL, you will use this plug-in name, prefixed by the package name from the Apama Package field (see below).
c. The Description field is optional.
d. The Apama Package field is optional. This is the package of the plug-in inside the correlator.
e. The Source Folder field specifies the folder in the project to contain the file. By default, this is java/src.
f. The Java Package field is optional, but by default corresponds to the Apama package name. This is the package of the created Java class.
3. Click Finish. The name of the new class file now appears in the Project Explorer view or the Workbench Project view under the project that contains it and the .java file opens in the editor. In Project Explorer, the icon indicates a Java plug-in to the correlator. 4. You will find the source file for your Java class in the java/src package in your project. You can now add functionality to the class as required for your application. This can be called from EPL using the mechanism described in
Using EPL plug-ins written in Java. For applications that you plan to inject into a correlator, the recommendation is to create separate jar files for:
EPL plug-ins written in Java
JMon applications
Note:
Apama's in-process API for Java (JMon) is deprecated and will be removed in a future release.
Although the mechanism for creating these jars and describing their meta-data is similar, the interactions of these two different uses of injected jars mean that they will often need to be injected into the correlator separately. The creation of separate jar files ensures that you can inject your application components in the correct order, which is typically:
1. EPL plug-ins written in Java
2. EPL monitors and events
3. JMon applications