Eclipse System Monitor Developer Reference

Introduction

Thanks for (considering to) contributing to Eclipse System Monitor. Eclipse System Monitor provides functionality to present system metrics to the user. These metrics require usually operating specific and/or native implementations. To separate pure Java / Eclipse functionality from OS specific functionality, the core components of System Monitor do not capture these metrics. Hence System Monitor rely on OS Specific Extensions that provides data for the metrics.

OS Specific Extensions are regular Eclipse plug-ins which realize System Monitor extension points to contribute to System Monitor. They encapsulate OS specific implementation of system data gathering and provide these data to System Monitor Core for presentation. Since these extensions are regular Eclipse plug-ins they have all the freedom Eclipse provides. The sections below describe briefly how an OS Specific Extensions can contribute to System Monitor.

Contributing an OS Specific Extension

Developing an OS Specific Extension

Development of an OS Specific Extension to Eclipse System Monitor is very much business as usual:

  1. Create a new Plug-In project in eclipse.
  2. Extend OS Specific Monitor Extension Point to contribute to System Monitor. The extension point requires the definition of the operating system the extension is designed for. This allows to install multiple extensions in one Eclipse environment. System Monitor selects the extension to use following the OS matching strategy as described below.
  3. Implement the required and possibly the optional interfaces defined by the Published System Monitor Core API and register the classes in the extension description accordingly.
  4. If special preferences shall be provided to the user, the extension can provide preference pages using standard Eclipse mechanisms and hook them under the System Monitor Preference Page in the tree of preference pages as described in section OS Specific Extension Preferences.
  5. The extensions shall provide help pages for end users for trouble shooting and especially if it provides an own UI, such as a preference page. Section Providing Help for the extension provides details on how help pages can be integrated into System Monitor help.
  6. Finally, deploy your OS Specific Extension as described in section Deploying an OS Specific Extension

OS matching strategy

Eclipse System Monitor selects the OS Specific Extension to use based on the OS name, OS version, and OS architecture Java provides for the hosting operating system by querying System.getProperty for "os.name", "os.version", and "os.arch".
These data are matched against the operating system related arguments declared in
OS Specific Monitor Extension Point by ranking the available extensions the way described below and choosing the extension with the highest rank.

The declaration of the OS attributes supports the following wildcards and operators that matches attributes of the hosting operating system:

The ranking of OS Specific Extensions is calculated as:

  1. Perfect match: All operating system attributes declared by the extension match perfectly (case insensitive) the attributes provided by Java. No wildcards are used in the declaration by the extension. If more than one extension matches perfectly, the first one found will be chosen.
  2. Wildcard match of OS name, perfect match for other attributes: Wildcards are used for the declared OS name, all other operating system attributes declared by the extension match perfectly (case insensitive) the attributes provided by Java. The less characters are substituted by wildcards the better the rank.
  3. Wildcard match of OS version and OS name, perfect match for OS architecture: Wildcards are used for the declared OS version, OS name is matched perfectly or against wildcards, OS architecture is a perfect match (case insensitive). The less the difference between the declared corner version and the hosting OS version the better the rank.
  4. Wildcard match of all OS attributes: Wildcards are used for the declared OS architecture, OS name and OS version may match perfectly or against wildcards. The less characters are substituted by wildcards the better the rank.

OS Specific Extension Preferences

The extension can provide preference pages using the standard Eclipse mechanisms for deploy preference pages, preference initialisation, and preference storage.

stefans.eclipse.systemmonitor.ui.preferences.SmPreferencePage
is the ID of the System Monitor preference page. By specifying this ID as attribute category for the eclipse preference page extension point (org.eclipse.ui.preferencePages) element page the preference page of the extension is hooked under the System Monitor preference page.

Providing Help for the extension

If an OS Specific Extension provides an own UI to the user or need to lend a hand for potential troubles, it should also contribute help pages. Help pages can be contributed using Eclipse extension point org.eclipse.help.toc in a straight forward way.
Extension help pages can be integrated on various locations into System Monitor help page structure to provide a consistent help structure to the user. Integration is done by declaring a link_to attribute to the regarding TOC root element that links the extension specific "TOC" into System Monitor's help.

Eclipse System Monitor provides the following anchor points for help pages:

Deploying an OS Specific Extension

Since you spent much work, inspiration, and transpiration developing an OS Specific Extension to Eclipse System Monitor is would be a pity not to share it. To ease deployment and to make it most comfortable for end user it is recommended to share the new extension via Eclipse System Monitor project page on sourceforge.net. The process for this really simple:

  1. Goto Eclipse System Monitor project page
  2. Navigate to Develop, Tracker, Feature Request
  3. Submit a new ticket for category "Submit OS Specific Extension". The ticket body describes in short words the features and operating system supported by the extension as well as the testing procedure applied that assures that the extension works as intended. The extension is attached to the ticket in source code as ZIP file, including Eclipse project files. The easiest way to achieve this is to export the project to file system (right click on project - Export... - Export File System) and ZIP the rot folder. This allows to bundle the extension properly.
  4. That's it, lean back, your extension will be made available asap via Eclipse System Monitor update site and as file download on the project page. Thanks for contributing (and please don't forget to vote for the project)!

Please note, that only extensions under Eclipse Public License (EPL) can be accepted.

Eclipse System Monitor Core API Reference