Solaris WBEM Developer's Guide

ProcedureHow to Register a Provider

You register a new or modified provider with the CIM Object Manager to communicate information about the data and operations that the provider supports. You also register a provider to notify the CIM Object Manager of the provider's location. The CIM Object Manager uses this information to load and initialize the provider, and to determine the appropriate provider for a particular client request.

Steps
  1. Create a Managed Object Format (MOF) file that defines the classes that the provider supports.


    Note –

    For more information on creating MOF files, see the DMTF Web site at http://www.dmtf.org.


  2. Include the provider qualifier in the MOF file to specify the provider type and location for the CIMOM.

    For example:

    [Provider("java:com.sun.providers.myprovider")]
    Class_name {
    …
    };

    This qualifier indicates the following information:

    • java: – The provider is written in the Java language and implements the javax.wbem.provider interfaces

    • com.sun.providers.myprovider – The name of the Java class that implements the provider

  3. Compile the MOF file by using the mofcomp(1M) command.


Example 6–4 Registering a Provider

This MOF file declares the Ex_SimpleCIMInstanceProvider class that is served by SimpleCIMInstanceProvider.

// ========================================================
// Title:       SimpleCIMInstanceProvider
// Filename:    SimpleCIMInstanceProvider.mof
// Description:
// ==================================================================

// ==================================================================
// Pragmas
// ==================================================================
#pragma Locale ("en-US")

// ==================================================================
//   SimpleCIMInstanceProvider
// ==================================================================
[Provider("java:SimpleCIMInstanceProvider")]
class Ex_SimpleCIMInstanceProvider
{
   // Properties
      [Key, Description("First Name of the User")]
   string First;
      [Description("Last Name of the User")]
   string Last;
};