Flex Output Adapter Sample

This sample demonstrates the use of the StreamBase Flex Output Adapter. The sample consists of two parts: a network monitoring StreamBase application and a Flex client application that displays monitored results.

The StreamBase application is driven by a custom input adapter that simulates IP network activity. The adapter emits tuples periodically representing network connections composed of a source and destination IP address and a TCP protocol value. Aggregrate operators then generate per-IP-address and per-protocol counts over various time-based windows. The results are fed into the Flex adapter for display by the Flex client application.

The Flex application contains several panels, each displaying a stream of data from the StreamBase application. Various Flex chart types are used, including a bar chart, an area chart, and a pie chart.

The sample also demonstrates use of the control stream to feed data from the Flex client to the StreamBase application. Changes to a speed-control slider on the client are sent via the Flex adapter to an input port of the IP simulator adapter, affecting the rate at which tuples representing simulated IP traffic are emitted.

Importing This Sample into StreamBase Studio

In StreamBase Studio, import this sample with the following steps:

  • From the top menu, click FileLoad StreamBase Sample.

  • Select this sample from the Embedded Adapters list.

  • Click OK.

StreamBase Studio creates a single project containing the sample files.

Installed Sample File Locations

By default, the sample files are installed in:

On Windows

C:\Program Files\StreamBase Systems\StreamBase.n.m\sample\adapter\embedded\flexserver\

On UNIX

/opt/streambase/sample/adapter/embedded/flexserver/

Preparing to Run the Sample

Ensure you have the Adobe Flash Player version 9 or later installed on your system. You can obtain the Flash Player from http://www.adobe.com.

Running This Sample in StreamBase Studio

  1. Import the flexserver sample application into a new project.

    1. Click FileLoad StreamBase Sample.

    2. Select the flexserver sample and click OK.

  2. In the Package Explorer, double-click to open the flex.sbapp application. Make sure the application is the currently active tab in the EventFlow Editor.

  3. Click the Run StreamBase Application (Default Launch) button. (Not the Run button.) This opens the Test/Debug perspective and starts the application.

  4. In the Test/Debug Perspective, open the Console view. If it is not already open, select WindowShow ViewConsole. Look for the following message indicating the Flex adapter is waiting for incoming connections from Flex clients:

    [notice] StreamBase Flex Adapter: Waiting to accept incoming connections on port 20000

  5. Open a StreamBase Command Prompt window. Navigate to the bin subdirectory of the sample's installation directory and type netmon.swf. This starts the sample Flex client application within the Adobe Flash Player.

  6. Click RunStop StreamBase Application (F9).

Running This Sample in a Terminal Window

  1. In a StreamBase Command Prompt window, change your working directory to the directory in which the sample is installed.

  2. Start the sample StreamBase application by typing:

    start sbd -f flex.sbconf flex.sbapp

    You should see the following message indicating the Flex adapter is waiting for incoming connections from Flex clients:

    [notice] StreamBase Flex Adapter: Waiting to accept incoming connections on port 20000

  3. Change your working directory to the sample's bin subdirectory

  4. Start the sample Flex client application by typing:

    netmon.swf