This part of the API Guide describes how to develop custom Java operators for StreamBase applications. A Java operator is a StreamBase component, inserted in the flow of a StreamBase application, that calls a custom Java method.
Java operators extend the following packages in the StreamBase Java Client library:
-
com.streambase.sb.operator -
com.streambase.sb.operator.parameter
Note
StreamBase Studio ships with new projects configured by default to build with Java 6. If you have a requirement to use Java 5, configure the Studio project that contains your custom code using the steps in Using Java 5 for Custom Extensions.
Designing, developing, and deploying Java operators in StreamBase Studio is similar to working with embedded adapters, and follows this general process:
-
Create the required Java class for your operator. We strongly recommend using the StreamBase Java Operator wizard to generate the base Java code, as described in the following topic.
-
Edit the Java source generated by the wizard to implement your specific functionality. The code includes // TODO markers, which indicate sections that need to be completed. The following topic contains information about writing Java operator code:
Creating Custom Java Operators
Pay special attention to the Methods for Studio Presentation section of that page.
-
If you are using third-party jars or native libraries, you may need to configure StreamBase Studio to correctly load the libraries:
-
Add the custom operator to a StreamBase application, as described in this Authoring Guide topic:
You can use the operator and test it in the StreamBase Studio environment without compiling or packaging it.
-
Deploy the operator, as described in Deploying Applications. Deployment involves package your operator into a JAR and exporting it to your file system. When you deploy your application, you will need to edit the
sbd.sbconffile that will run it, defining theoperator-resource-searchelement to identify the deployed location of your operator JAR.
