Eclipse System Monitor OS Specific Extension Point

Identifier:
stefans.eclipse.systemmonitor.osSpecificMonitor

Since:
Eclipse System Monitor v0.7.0

Description:
This extension point to Eclipse System Monitor allows to define OS dependent implementation of monitors and information providers.

Since Eclipse System Monitor is OS independent but relays on OS dependent information regarding OS dependent extension are required. Usually a single plug-in defines an extension for a single operating system, but nevertheless it is also possible that one plug-in declares extensions for multiple operating systems.

The extension that will be used by Eclipse System Monitor is determined by the provided OS name, OS version, and OS architecture of the extension. The selection mechanism matches the extension against the values of the above mentioned attributes as provided by Java VM system properties "os.name", "os.version", and "os.arch". Hence the corresponding attributes of this extension point must match the values provided by the Java VM in order match. Wildcard "*" for os.name, os.version, and os.arch as well as operators ">=", "<=", and "-" (range) are supported for os.version. The match will be performed case insensitive.

Configuration Markup:

<!ELEMENT extension (monitor+)>

<!ATTLIST extension

point CDATA #REQUIRED

id    CDATA #IMPLIED

name  CDATA #REQUIRED

>

Root element for the extension.



<!ELEMENT monitor EMPTY>

<!ATTLIST monitor

javaOsName         CDATA #REQUIRED

javaOsVersion      CDATA #REQUIRED

javaOsArchitecture CDATA #REQUIRED

cpuLoadMonitor     CDATA #REQUIRED

osInfoProvider     CDATA #IMPLIED

>

Declares the OS specific monitor.



Examples:

Full declaration:

   <extension
         id="sampleMonitor"
         name="Sample OS Monitor"
         point="stefans.eclipse.systemmonitor.osSpecificMonitor">
      <monitor
            javaOsName="Sample OS Name"
            javaOsVersion="Sample OS Version"
            javaOsArchitecture="Sample OS Arch"
            cpuLoadMonitor="stefans.eclipse.systemmonitor.extension.mySampleCpuLoadMonitor"
            osInfoProvider="stefans.eclipse.systemmonitor.extension.mySampleOsInfoProvider">
      </monitor>
   </extension>

Minimum declaration:

   <extension
         name="Sample OS Monitor"
         point="stefans.eclipse.systemmonitor.osSpecificMonitor">
      <monitor
            javaOsName="Sample OS Name"
            javaOsVersion="Sample OS Version"
            javaOsArchitecture="Sample OS Arch"
            cpuLoadMonitor="stefans.eclipse.systemmonitor.extension.mySampleCpuLoadMonitor">
      </monitor>
   </extension>

API Information:

The value of the attribute javaOsName must match the value provided by System.getProperty("os.name"); for the intended operation system. Wildcard ("*") thats matches 0 to n characters is supported.
The value of the attribute javaOsVersion must match the value provided by System.getProperty("os.version"); for the intended operation system. The following operators and wildcards are supported:
The value of the attribute javaOsArchitecture must match the value provided by System.getProperty("os.arch"); for the intended operation system. Wildcard ("*") thats matches 0 to n characters is supported.
The value of the attribute osInfoProvider must represent a fully qualified name of the class that implements stefans.eclipse.systemmonitor.os.api.IOsInfoProvider.
The value of the attribute cpuLoadMonitor must represent a fully qualified name of the class that implements stefans.eclipse.systemmonitor.os.api.ICpuLoadMonitor.

Supplied Implementation:
Eclipse System Monitor selects the extension to use using attributes javaOsName, javaOsVersion, javaOsArchitecture by matching it perfectly or fuzzy (using wildcard and version operators) and case insensitive against the regarding values provided by Java VM on the regarding platform. This allows multiple contributing plugins to be installed (e.g. for the purpose of multi-platform environments). Eclipse System Monitor selects the OS Specific Extension by calculating the rank of the match for each extensions. The extension with the highest ranks is activated.

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.
Plugins contributing extensions that are not matching the hosting environment will not be activated by Eclipse System Monitor.


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.