Developing StreamBase Embedded Adapters

Overview

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.

The Development Process

Designing, developing, and deploying embedded adapters in StreamBase Studio is similar to working with Java operators, and follows this general process:

  1. 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:

    Using the StreamBase Embedded Adapter Wizard

  2. Edit the Java source generated by the wizard to implement your specific functionality. The code includes // TODO markers that indicate sections that need to be completed. The following topic contains detailed information about writing adapter code:

    Using the Embedded Adapter API

  3. Add the adapter to a StreamBase application, as described in this Authoring Guide topic:

    Adding an Embedded Adapter

    You can use the adapter and test it in the StreamBase Studio environment without compiling or packaging it.

  4. 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.sbconf file that will run it, defining the operator-resource-search element to identify the deployed location of your adapter JAR.