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.
Developing an OS Specific Extension
Development of an OS Specific Extension to Eclipse System Monitor is very much business as usual:
- Create a new Plug-In project in eclipse.
- 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.
- 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.
- 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.
- 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.
- Finally, deploy your OS Specific Extension as described in section
Deploying an OS Specific Extension
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:
- * (wildcard star) Matches zero or more character. Supported for OS-name,
OS-version, and OS-architecture. For OS-versions, "*"
is treated as wildcard for one or more complete version digits (e.g. *, *.3, 4.*, 4.*.1)
but not for parts of a digit (e.g. 4*, 4.1*, 4.2*1)
Examples:
- "Win*" matches "Windows" and "Windows XP"
- "Win*Vista" or "W*V*" or "*Vista" matches "Windows Vista"
- "*" matches any OS name, OS version or OS architecture.
- "4.*" matches any version starting with "4"
- "4.*.1" matches "4.0.1", "4.1.1", "4.1.1", "4.3.2.1", 4.a.b.1", but not "4.1", "4.1.1.1" or "4.0.1.0".
- "4.*.*" is equivalent to "4.*".
- "4*.1" or "4.*1" does not match any version.
- >=version (greater than or equal to version) Matches versions that are greater
or equal to the declared version.
The operator must be the first element of the version declaration. When this operator is used,
wildcard "*" is permitted (matches only "*"). Supported for OS-version.
Examples:
- ">=4.0" matches "4", "4.0", "4.0.1", "4.1.2", "5"
- <=version (less than or equal to version) Matches versions that are less or
equal to the declared version.
The operator must be the first element of the version declaration. When this operator is used,
wildcard "*" is permitted (matches only "*"). Supported for OS-version.
Examples:
- "<=4.0" matches "4", "4.0", "3.9.9", "2"
- version1-version2 (between version1 and version 2) Matches versions that are
greater or equal to "version1" and less or equal "version2".
The operator must be located between two version declarations. When this operator is used,
wildcard "*" is permitted (matches only "*"). A match of this pattern is
considered as perfect match. Supported for OS-version.
Examples:
- "4.0-5.0" matches "4", "4.0", "4.0.1", "5", but not "3.0" or "5.0.1"
- "4.0-4.0" matches "4", "4.0" but not "4.0.1", "5", "3.0" or "5.0.1"
- "5.0-4.0" does not match any version
The ranking of OS Specific Extensions is calculated as:
- 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.
- 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.
- 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.
- 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.
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.
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:
- User Guide, Operating System Specific Information:
../stefans.eclipse.systemmonitor/doc/help/toc.xml#cpu_monitor_os_specific_user_guide
TOCs hooking to this anchor shall use the name of the operating system as title.
- Developer Reference, Published API Reference:
../stefans.eclipse.systemmonitor/doc/help/toc.xml#published_api
if the extension itself is extendible and provides a published API that can be used by other plug-ins.
- Developer Reference, Extension Points:
../stefans.eclipse.systemmonitor/doc/help/toc.xml#extension_points
if the extension itself is extendible and provides extension points.
- Developer Reference, Public API Reference:
../stefans.eclipse.systemmonitor/doc/help/toc.xml#public_api
- Directly under Eclipse System Monitor root
../stefans.eclipse.systemmonitor/doc/help/toc.xml#further_main_topics
to present additional help very prominently.
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:
- Goto Eclipse System Monitor project page
- Navigate to Develop, Tracker, Feature Request
- 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.
- 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
Copyright (c) 2009, sTEFANs.
All rights reserved. This program and the accompanying materials are made available under
the terms of the Eclipse Public License v1.0 which accompanies this distribution,
and is available at http://www.eclipse.org/legal/epl-v10.html