JADE Supervisor
A JADE Supervisor instance runs anytime an application runs in JADE, providing visibility and control over all plugin instances in the application.
Right-clicking on a given plugin reveals the options for interacting with and controlling plugins directly from the Supervisor.
The following breaks down the options seen in the right-click menu:
View Configuration & Errors (menu option)
This option opens a read-only instance of a Plugin Editor showing the plugin configuration loaded at the time the application was run.
Runtime errors are indicated with a red error count in the lower left corner and full error details display in the expandable gutter.
We will discuss errors further in the Observing Errors
section below.
Clear Errors (menu option)
This option clears any errors shown in the Supervisor and any open read-only configuration editors. We will discuss errors further in the Observing Errors
section below.
Show Interface (menu option)
This option shows the plugin instance’s interface. Plugin interfaces optionally show when run but can always be displayed with this option.
Show Interface (menu option)
This option hides the plugin instance’s interface. Plugin interfaces optionally show when run but can always be closed / hidden with this option.
Run (menu option)
This option is available when a plugin isn’t currently running. For example, suppose we deselect the Data Table plugin instance in the Application Manager:
If we now run the application, the Data Table plugin instance is Loaded
but not Running
:
When we right-click, we then see the Run
option available:
And if we choose the Run
option, the plugin indeed runs:
Shutdown (menu option)
This option is available when a plugin is running and shuts down the plugin instance:
And after choosing the Shutdown
option, the plugin is Stopped
:
Observing Errors
We saw above that plugin errors will render in the read-only configuration editor which can be opened by right-clicking in the JADE Supervisor and choosing View Configuration & Errors
.
We also see the first error to have occurred for a given plugin in the Supervisor. That is, if multiple errors occur for a given plugin, we persist the first error since that’s typically where we want to start exploring & debugging.
To view subsequent errors here, use the Clear Errors
option as discussed above and the next error to occur will display. To see all errors, use the View Configuration & Errors
option discussed above.
Supervisor Published Data
The data published by a Supervisor includes status information about all running plugins. To subscribe to this data, simply use __PLUGIN_INFO__
in the subscribesTo
array for any plugin which handles such data. Below is an example of the Supervisor’s __PLUGIN_INFO__
paylaod where the application consists of 3 plugins with instance names: “Serial Publisher 1”, “Serial Publisher 2”, and “My Subscriber”. The structure seen below is representative, where each plugin will have its info placed under a key name equal to its instance name.
{
"timestamp": 3753241024.79381,
"workerName": "__PLUGIN_WORKER_41EBF6BD322192E917__",
"pluginInfo": {
"Serial Publisher 1": {
"status": "Running",
"type": "Serial Publisher",
"version": "v1.1",
"message": "The plugin instance is running."
},
"Serial Publisher 2": {
"status": "Running",
"type": "Serial Publisher",
"version": "v1.1",
"message": "The plugin instance is running."
},
"My Subscriber": {
"status": "Running",
"type": "Subscriber",
"version": "v1.1",
"message": "The plugin instance is running."
}
}
}
Supervisor Control Messages
The Supervisor can also accept control messages from other plugins. For example, suppose we have a State Machine
plugin in our system which is monitoring system data, and when a certain condition is met we are to run a specific plugin instance (which is in our application, but perhaps not set to run immediately, i.e. it was “unchecked” in the list). Well, all the State Machine would need to do in that case is send the correct message to the Supervisor. Below are examples of each message supported by Workers. Notice the common structure where all messages are JSON objects with elements: “operation” (string) and “data” (object).
Running a Plugin Instance
The following message sent to the Supervisor would run the plugin instance: “Serial Publisher 1”.
{
"operation": "Instance Run",
"data": {
"InstanceName": "Serial Publisher 1"
}
}
Shutting Down a Plugin Instance
The following message sent to the Supervisor would shut down the plugin instance: “Serial Publisher 1”.
{
"operation": "Instance Shutdown",
"data": {
"InstanceName": "Serial Publisher 1"
}
}
Shutting Down All Plugin Instances
The following message sent to the Supervisor would shut down all plugin instances.
{
"operation": "Shutdown Instances",
"data": {}
}
Opening a Plugin Instance Panel / Interface
The following message sent to the Supervisor would open the panel / interface associated instance: “Serial Publisher 1”.
{
"operation": "Instance Show Front Panel",
"data": {
"InstanceName": "Serial Publisher 1"
}
}
Hiding a Plugin Instance Panel / Interface
The following message sent to the Supervisor would close the panel / interface associated instance: “Serial Publisher 1”.
{
"operation": "Instance Hide Front Panel",
"data": {
"InstanceName": "Serial Publisher 1"
}
}
Shutting Down A Supervisor
The following message sent to the Supervisor would shut down the Supervisor, which would of course shut down all of the plugin instances running under that Supervisor’s domain. It would be unusual in most cases to do this since usually we want the Supervisor to remain available so we can control the application by sending it messages. Nonetheless, we expose it as there may be corner cases where it’s useful.
{
"operation": "Close Application",
"data": {}
}