Package com.ms.util Previous
Previous
Microsoft Packages
Microsoft Packages
Index
Index
Next
Next

Class SystemVersionManager

Constructors , Methods

public class SystemVersionManager implements Runnable
{
	// Constructors
	public SystemVersionManager ( );

	// Methods
	public void run();	
	public static Properties createVersion (int major, int minor, int buildnum, int buildinc, String  description);
	public static Properties getVMVersion ();
	public static Properties getPackageVersion (String pkgname);
	public static Properties getSystemComponentVersion (String compname);	
	public static Enumeration enumerate ();
}

The SystemVersionManager class provides methods for setting and retrieving system version properties. This class is not typically called directly, but rather is used by implementing a VersionManager class that is derived from it. See the samples\Version directory in the Microsoft Java SDK for a standard implementation of a VersionManager class, which you can add to your distributed packages "as is" to provide applications with the ability to check the version information of the system components and your distributed classes. The VersionManager sample class works on any VM, whereas the SystemVersionManager class is provided specifically for the Microsoft VM.

When VersionManager methods are called, it first calls the SystemVersionManager methods to return system information. If the SystemVersionManager class returns nothing or does not exist, and the applet or application is running on the Microsoft VM, then sample implemention of the VersionManager class returns the information for the 3.0 release. The package information retrieved by the VersionManager works in any VM. The system information, of course, only works on the Microsoft VM.

You can request a package by name using the getPackageVersion method and it will look for a Version (*.Version) class in that package or a superpackage for the information. The version information is in a Properties object. All version objects have the following keys:

All values are stored as Strings. You can also request information about the following system components using getSystemComponentVersion:


Constructors


SystemVersionManager

SystemVersionManager ()

Creates a runnable object that provides methods for creating and retrieving system version property objects.


Methods


run

public void run()

Method executed when the thread started in SystemVersionManager.getSystemComponentVersion is started.

Return Value:

No return value.

Remarks:

This method retrieves the value of the ClassesBuild string in the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Java VM registery key.


createVersion

 public static Properties createVersion (int major, int minor, int buildnum, int buildinc, String description) 

Creates a version object given the appropriate parameters.

Return Value:

Returns a Property object containing version properties.

ParameterDescription
major Major version number.
minor Minor version number.
buildnum The build number.
buildinc The incremental build number.
description A string description of the version.

Remarks:

A typical example of this is the following internal call to createVersion, which creates a version object for system classes prior to incremental build 1155:

createVersion(4, 79, 0, 1154, "Microsoft (R) System Classes, 3.0 Prerelease");

getVMVersion

public static Properties getVMVersion ()

Retrieves version data for the Virtual Manager (VM).

Return Value:

Returns a Properties object containing the VM version data.


getPackageVersion

public static Properties getPackageVersion (String pkgname)

Retrieves version information for the specified package.

Return Value:

Returns a Properties object containing the package version data.

ParameterDescription
pkgname name of the package.


getSystemComponentVersion

public static Properties getSystemComponentVersion (String compname)

Retrieves version information for the specified component.

Return Value:

Returns a Properties object containing the version information.

ParameterDescription
compname The system component name, which can be one of the components returned by the enumerate method.


enumerate

public static Enumeration enumerate ()

Retrieves the default system components to provide version information for.

Return Value:

Returns an Enumeration object containing the following String objects:
String Description
VM The Virtual Machine version
Classes The version of the system classes
TrustedClasses The version of the classes in the TrustedLib path.



Top© 1996 Microsoft Corporation. All rights reserved.