WBEMfor Solaris on Sun Developer's Guide

Registering a Provider

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. Neither the CIM Object Manager or the provider needs to be running during the registration process.

How To Register a Provider
  1. Create a MOF file defining a CIM class.

  2. 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:


    Note -

    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.


    [Provider("com.kailee.wbem.providers.provider_name")]
    Class_name {
    ...
    };

  3. Compile the MOF file. For example:

    mofcomp class_name

Example -- Registering a Provider

The sample MOF file in Example 7-5 creates a class called Fruit that registers an instance provider (fruit_class_provider), a property provider (fruit_prop_provider), and a method provider (fruit_method_provider).


Example 7-5 Registering an Instance, Property, and Method Provider

 
// Registers fruit_class_provider as the provider for the Fruit class
[Provider("com.food.fruitprovider.fruit_class_provider")] 
 
Fruit {
 
// fruit_prop_provider is the provider for property a
		[Provider("com.food.fruitprovider.fruit_class_provider")] 
-		string a;
 
		// fruit_prop_provider is also the provider for property b
		[Provider("com.food.fruitprovider.fruit_class_provider")] 
		string b;
 
		// fruit_method_provider is the provider for method b
		[Provider("com.food.fruitprovider.fruit_class_provider")] 
		int b();
};