Providers register with the CIM Object Manager to publish information about the data and operations they support and their physical implementation. The CIM Object Manager uses this information to load and initialize the provider and to determine the right provider for a particular client request. All types of providers follow the same procedure for registration.
Create a MOF file defining a CIM class.
Assign the provider qualifier to the class. Assign a provider name to the provider qualifier.
The provider name identifies the Java class to serve as the provider for this class. You must specify the complete class name. For example:
[Provider("com.kailee.wbem.providers.provider_name")] Class_name { … };
We recommend following Java class and package naming conventions for providers so that provider names are unique. The prefix of a unique package name is always written in all-lowercase ASCII letters and should be one of the top-level domain names, currently com, edu, gov, mil, net, org, or one of the English two-letter codes identifying countries as specified in ISO Standards 3166, 1981.
Subsequent components of the package name vary according to an organizations own internal naming conventions. Such conventions might specify that certain directory name components be division, department, project, machine, or login names, for example, com.mycompany.wbem.myprovider.
Compile the MOF file. For example:
% mofcomp class_name |
For more information on using the Managed Object Format (MOF) Compiler to compile a MOF file, see the Solaris WBEM Services Administrator's Guide.
If you change a class definition in a MOF file that was previously compiled, you must delete the class from the CIM Object Manager Repository before recompiling the MOF file. Otherwise, you will get an error that the class already exists and the new information will not propagate to the CIM Object Manager. You can use the CIM WorkShop to delete a class as described in Deleting Classes and Their Attributes.
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; };