Contents
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.
In StreamBase Studio, import this sample with the following steps:
-
From the top menu, click → .
-
Select this sample from the Embedded Adapters list.
-
Click OK.
StreamBase Studio creates a single project containing the sample files.
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/
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.
-
Import the flexserver sample application into a new project.
-
Click → .
-
Select the flexserver sample and click .
-
-
In the Package Explorer, double-click to open the
flex.sbappapplication. Make sure the application is the currently active tab in the EventFlow Editor. -
Click the
Run StreamBase Application (Default Launch) button.
(Not the Run button.) This opens the
Test/Debug perspective and starts the application.
-
In the Test/Debug Perspective, open the Console view. If it is not already open, select → → . 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 -
Open a StreamBase Command Prompt window. Navigate to the
binsubdirectory of the sample's installation directory and typenetmon.swf. This starts the sample Flex client application within the Adobe Flash Player. -
Click → ().
-
In a StreamBase Command Prompt window, change your working directory to the directory in which the sample is installed.
-
Start the sample StreamBase application by typing:
start sbd -f flex.sbconf flex.sbappYou 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 -
Change your working directory to the sample's
binsubdirectory -
Start the sample Flex client application by typing:
netmon.swf
