The following example shows the MOF file that declares to the CIM Object Manager the Ex_SimpleInstanceProvider class that is served by the SimpleInstanceProvider (shown in Example 5–1). Provider and class names in a valid MOF file follow these rules:
The class name must be a valid CIM Schema name, which means that it must have a prefix of characters followed by an underscore. For example: green_apples and red_apples are valid CIM schema names. The class name apples is not a valid CIM Schema name.
The class name must match the class name specified in the provider for this MOF file. The MOF file in Example 5–5 declares the Ex_SimpleInstanceProvider class. For example:
class Ex_SimpleInstanceProvider
The enumInstances method in the provider in Example 5–1 specifies the same class name. For example:
public Vector enumInstances(CIMObjectPath op, boolean deep, CIMClass cc) throws CIMException { if (op.getObjectName().equalsIgnoreCase("Ex_SimpleInstanceProvider"))
The provider name specified in the MOF file must match the name of the provider class file. The MOF file in Example 5–5 specifies the SimpleInstanceProvider as the provider for the Ex_SimpleInstanceProvider class. For example:
[Provider("SimpleInstanceProvider")] class Ex_SimpleInstanceProvider
// =================================================================== // Title: SimpleInstanceProvider // Filename: SimpleInstanceProvider.mof // Description: // =================================================================== // ================================================================== // Pragmas // ================================================================== #pragma Locale ("en-US") // ================================================================== // SimpleInstanceProvider // ================================================================== [Provider("SimpleInstanceProvider")] class Ex_SimpleInstanceProvider { // Properties [Key, Description("First Name of the User")] string First; [Description("Last Name of the User")] string Last; };