This part of the API Guide describes how to develop both custom custom embedded adapters for StreamBase applications.
An embedded adapter is a StreamBase component, inserted in the flow of a StreamBase application, that calls a custom Java method. It runs in the same server process (sbd) that is hosting and processing your StreamBase application's requests. Embedded adapters start and stop automatically with the StreamBase application, simplifying many administration tasks, and can eliminate the client/server communication overhead seen with external adapters.
Embedded adapters extend the following packages in the StreamBase Java API:
com.streambase.sb.adapter.InputAdapter
com.streambase.sb.adapter.OutputAdapter
Embedded adapters inherit some behavior from operators, and both InputAdapter and OutputAdapter are
subclasses of com.streambase.sb.operator.Operator.
Migration Note
If you are using any pre-3.7 custom embedded adapters, their sources must be edited to work with this release of StreamBase, as described in Using the Embedded Adapter API.
Designing, developing, and deploying embedded adapters in StreamBase Studio is similar to working with Java operators, and follows this general process:
-
Create the required Java class for your adapter. We strongly recommend using the StreamBase Embedded Adapter wizard to generate the base Java code, as described in this topic:
-
Edit the Java source generated by the wizard to implement your specific functionality. The code includes
// TODOmarkers that indicate sections that need to be completed. The following topic contains detailed information about writing adapter code: -
If you are using third-party jars or native libraries, you may need to configure StreamBase Studio to correctly load the libraries:
-
Add the adapter to a StreamBase application, as described in this Authoring Guide topic:
You can use the adapter and test it in the StreamBase Studio environment without compiling or packaging it.
-
Deploy the adapter.
If you are creating an adapter that you want to share with others as a global adapter, you must create a manifest, as described in Creating Manifest Files for StreamBase Adapters. Otherwise, no manifest is required.
Deployment is described in Deploying Applications. It involves packaging your adapter 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 adapter JAR.
