Using Interfaces with Extension Points

This page discusses interfaces as used with the Extension Point operator. See StreamBase Interfaces for a general overview of StreamBase interfaces, and for interfaces used as templates for new and existing application modules.

Using the Extension Point Operator

The Extension Point operator is like a Module Reference for interfaces. In the same way that a Module Reference provides input and output ports for sending the flow of tuples into a referenced module, the Extension Point operator references an interface, and provides input and output ports for sending the flow of tuples into one or more modules that implement that interface. An Extension Point operator hosts one or more module instances that implement the interface referenced by that operator. Each module instance is assigned a name to be used when uniquely addressing an individual module instance.

Add an Extension Point operator to an EventFlow application module in one of the following ways:

  • Locate an interface definition file with .sbint extension in the Module Explorer and drag it to the canvas.

  • Drag an Extension Point operator token from the Operators and Adapters drawer of the Palette view to the canvas. In this case, open the Modules tab of the Properties view for the new operator to specify the interface file that this operator will reference.

See Using the Extension Point Operator for details on the Property view settings for the operator.

Dispatching Tuples to Modules by Name

When one or more modules are listed as module instances for an Extension Point operator, incoming tuples are routed to those modules according to the dispatch style for each of the operator's incoming streams, as specified on the Concurrency tab of the Properties view for the operator. Two dispatch styles are available for the input streams of an Extension Point:

  • Broadcast. Send incoming tuples in parallel to all module instances of the Extension Point operator.

  • Name. Route incoming tuples to one of the operator's module instances by module instance identifier, using logic in upstream components to determine the identifier of the module to call before entering the operator.

You can specify dispatch styles independently for each input stream of an Extension Point operator. Tuples are dispatched the same when the Extension Point operator specifies its modules locally or externally.

See Using the Extension Point Operator, Concurrency Options, and Dispatch Styles for further information.

Shared Query Table Limitation

For use with an Extension Point operator, StreamBase supports interfaces that define a placeholder Query Table, but cannot support interfaces that define a shared Query Table.

Placeholder Query Tables define and stand in for a real Query Table in the module that implements this interface, and it is up to the implementing module to add a real Query Table that references the interface's placeholder table.

By contrast, shared Query Tables are actual Query Table objects that can be accessed by more than one module. Remember that an Extension Point operator can host two or more module instances that implement the same interface. If the interface could include a shared Query Table, then each module instance would need to have access to the same shared Query Table.

There is no provision for maintaining the state of potentially dozens of modules, all needing concurrent access to the same shared Query Table. For this reason, shared Query Tables cannot be defined in interfaces that are referenced by an Extension Point operator.

You are free to define shared Query Tables for an interface that will be used as a template.