JMX Adapter Sample

Introduction

This topic describes how to run the sample application for the Spotfire Streaming Java Management Extensions (JMX) Adapter.

The sample, JMXSample.sbapp, demonstrates how to connect to a JMX server and query infos.

Importing This Sample into StreamBase Studio

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

  • From the top-level menu, select File>Import Samples and Community Content.

  • Enter JMX to narrow the list of options.

  • Select Java Management Extensions (JMX) Adapter from the StreamBase Standard Adapters category.

  • Click OK.

StreamBase Studio creates a single project for the JMX adapter samples in your current Studio workspace.

Running the JMX Sample in StreamBase Studio

Run this sample in Studio as follows:

  1. In the Project Explorer view, open this sample's folder.

    Keep an eye on the bottom right status bar of the Studio window. Make sure any Updating, Downloading, Building, or Rebuild project messages finish before you proceed.

  2. Open the src/main/eventflow/packageName folder.

  3. Double-click to open the JMXSample.sbapp application.

  4. Double-click the JMXControl adapter, enter valid host and port, also make sure the corresponding JMX server is up.

  5. Make sure the application is the currently active tab in the EventFlow Editor, then click the Run button. This opens the SB Test/Debug perspective and starts the application.

  6. In the Manual Input view, select the Control Input stream and type connect in the command field. If "connect on startup" is selected, no need to enter command.

  7. Click Send Data. In the Output Streams view, look for the Connected at control status output.

  8. In the Manual Input view, select the Query stream.

    1. Enter valid query command for "query": listDomains, listMBeans, listAttributes

    2. Enter list of beanNames you want to query. Wildcards are allowed. For example: d:type=Foo,name="B*" will match e.g. d:type=Foo,name="Bling".

    3. Enter list of attributeNames you want to query.

  9. Click Send Data. In the Output Streams view, look for data and status output.

  10. In the Manual Input view, select the AttributeQuery stream.

    • Enter list of beanNames you want to query. Wildcards are allowed. For example: d:type=Foo,name="B*" will match e.g. d:type=Foo,name="Bling".

    • Enter list of attributeNames you want to query.

  11. Click Send Data. In the Output Streams view, look for the attributes' value and status output.

  12. When done, press F9 or click the Stop Running Application button.

Sample Location

When you load the sample into StreamBase® Studio, Studio copies the sample project's files to your Studio workspace, which is normally part of your home directory, with full access rights.

Important

Load this sample in StreamBase® Studio, and thereafter use the Studio workspace copy of the sample to run and test it, even when running from the command prompt.

Using the workspace copy of the sample avoids permission problems. The default workspace location for this sample is:

studio-workspace/sample_adapter_embedded_JMX

See Default Installation Directories for the default location of studio-workspace on your system.