Contents
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.
In StreamBase Studio, import this sample with the following steps:
-
From the top-level menu, select
> . -
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.
Run this sample in Studio as follows:
-
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
, orRebuild project
messages finish before you proceed. -
Open the
src/main/eventflow/
folder.packageName
-
Double-click to open the
JMXSample.sbapp
application. -
Double-click the
JMXControl
adapter, enter valid host and port, also make sure the corresponding JMX server is up. -
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.
-
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. -
Click
. In the Output Streams view, look for theConnected
at control status output. -
In the Manual Input view, select the Query stream.
-
Enter valid query command for "query": listDomains, listMBeans, listAttributes
-
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.
-
-
Click
. In the Output Streams view, look for data and status output. -
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.
-
-
Click
. In the Output Streams view, look for the attributes' value and status output. -
When done, press F9 or click the Stop Running Application button.
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.