Contents
This sample demonstrates the use of the Adobe Flex Output Adapter. The sample consists of two parts: a network monitoring StreamBase application and a Flex client application that displays monitored results.
Note
The Adobe Flex Output adapter is deprecated as of StreamBase release 7.2.5 and will be removed in a future release.
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. Aggregate 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/
When you load the sample into StreamBase Studio, Studio copies the sample project's
files to your Studio workspace. StreamBase Systems recommends that you use the
workspace copy of the sample, especially on UNIX, where you may not have write access
to /opt/streambase. In the default installation, the
path to this sample in your Studio workspace is:
UNIX: ~/streambase-studio-n.m-workspace/sample_adapter_embedded_flexserver Windows XP: C:\Documents and Settings\username\My Documents\StreamBase Studion.mWorkspace\ sample_adapter_embedded_flexserver Windows 7 and Windows Vista: C:\Users\username\Documents\StreamBase Studion.mWorkspace\ sample_adapter_embedded_flexserver
-
Make sure you have the Adobe Flash Player version 9 or later installed on your system. You can obtain the Flash Player for Windows and Linux from http://www.adobe.com.
-
Make sure Flash player is enabled as an add-on in your web browser.
-
Open a web browser that has the Flash player enabled as an add-on.
-
Outside of Studio, open Windows Explorer on Windows and navigate to the directory where the sample is installed, or to your workspace copy of the sample, as described above. Go to the
binsubdirectory.On UNIX, use your favorite file browser such as Nautilus, and navigate to this sample's
bindirectory, as above. -
The
bindirectory contains a single Flash file,netmon.swf. Drag thenetmon.swffile to the web browser. This browser now contains the Flash-based network monitor application, but without any activity showing. -
In StreamBase Studio, 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 button. This opens the SB
Test/Debug perspective and starts the application.
-
Return to your web browser and invoke its refresh function. The Flash network monitoring application now shows activity being fed from the running StreamBase application.
-
When done, press F9 in Studio or click the
Stop Running Application
button.
This section describes how to run the sample in UNIX terminal windows or Windows command prompt windows. On Windows, be sure to use the StreamBase Command Prompt from the Start menu as described in the Test/Debug Guide, not the default command prompt.
-
Open two terminal windows on UNIX, or two StreamBase Command Prompts on Windows. In each window, navigate to the directory where the sample is installed, or to your workspace copy of the sample, as described above.
-
For Windows, follow steps 1 through 3 of the previous section to start your web browser running the
netmon.swfFlash program. -
For UNIX, in window 1, navigate to the
binsubdirectory of the sample's directory. Start a Flash-enabled web browser with the Flash file as an argument. For example:firefox ./netmon.swf
-
In windows 2, start the sample StreamBase application by typing:
start sbd -f flex.sbconf flex.sbapp
Observe 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 -
Return to your web browser and invoke its refresh function. The Flash network monitoring application now shows activity being fed from the running StreamBase application.
-
In window 1, run
sbadmin shutdownto close the server.
