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.
- point - The fully qualified identifier of the target extension point (stefans.eclipse.systemmonitor.osSpecificMonitor).
- id - The optional ID of the extension.
- name - The name of the extension which is presented to the user.
<!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.
- javaOsName - The name of the operating system this monitor is targeting as provider by System.getProperty("os.name"); on the regarding platform.
- javaOsVersion - The version of the operating system this monitor is targeting as provider by System.getProperty("os.version"); on the regarding platform.
- javaOsArchitecture - The architecture of the operating system this monitor is targeting as provider by System.getProperty("os.arch"); on the regarding platform.
- cpuLoadMonitor - The required class which monitors the CPU load. It must implement stefans.eclipse.systemmonitor.os.api.ICpuLoadMonitor.
- osInfoProvider - The optional class which provides OS specific information of the underlying operating system. This allows to provide more specific information about the operating system as provided by Java. It must implement stefans.eclipse.systemmonitor.os.api.IOsInfoProvider.
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:
- >=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 character "*").
- <=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 character "*").
- version1-version2 (between version1 and version 2, range): 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 character "*"). A match of this pattern is considered as perfect match.
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
- * (wildcard star): Matches one or more complete version digits.
Examples:
- "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*.1" or "4.*1" does not match any version
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:
- 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.
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.