Adding an EPL Plug-in written in Java
To add a new correlator plug-in written in Java to an Apama project:
1. If you are in the Apama Workbench perspective, click the Show All Folders icon if necessary to display the enhanced view that shows all the project’s resources. 2. In the Project Explorer view or the Workbench Project view, right click the name of the project where you want to add the correlator 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.
3. 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.
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; this is the package of the created Java class.
4. 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. 5. Select the Show All Folders icon in the Project View pane. 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 Java plug-ins. 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
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