Solaris WBEM Developer's Guide

Creating a Base Class

Note –

You can also create a base class using the MOF language. If you are familiar with MOF syntax, use a text editor to create a MOF file. Then use the MOF compiler to compile the file into Java classes. See Chapter 7, Creating JavaBeans Components Using the MOF Compiler.

Use the CIMClass class to create a Java class representing a CIM class. To declare the most basic class, you need only specify the class name and a key property or an abstract qualifier. However, most classes include properties that describe the data of the class. To declare a property, include the property's data type, name, and an optional default value. The property data type must be an instance of CIMDataType.

A property can have a key qualifier, which identifies the property as a key property. A key property uniquely defines the instances of the class. Only keyed classes can have instances. Therefore, if you do not define a key property in a class, the class can only be used as an abstract class. If you define a key property in a class in a new namespace, you must first compile the core MOF files into the namespace. The core MOF files contain the declarations of the standard CIM qualifiers, such as the key qualifier.

Class definitions can be more complicated, including such features as aliases, qualifiers, and qualifier flavors.