WBEMfor Solaris on Sun Developer's Guide

Setting Up the Provider Example

The example provider program, NativeProvider, enumerates instances and gets properties for instances of the Native_Example class. You can use the CIM WorkShop to view this class and its instances.

How to Set Up the Provider Example
  1. Specify the location of shared library files in one of the following ways:

    • Set the LD_LIBRARY_PATH environment variable to the location of the shared library files. For example:

      % set LD_LIBRARY_PATH /install_dir/SUNWconn/wbem/demo/provider/jni/
      

    • Copy the shared library files to the directory specified by the LD_LIBRARY_PATH environment variable. Installation sets this environment variable to /install_dir/opt/SUNWconn/wbem/lib. For example:

    % cp libnative.so /install_dir/opt/SUNWconn/wbem/lib
    % cp native.c /install_dir/opt/SUNWconn/wbem/lib
    % cp Native_Example.h /install_dir/opt/SUNWconn/wbem/lib
    

  2. Move the provider class files to the directory containing the CIM Object Manager. For example:

    % mv Native*.class /install_dir/opt/SUNWconn/wbem/bin
    

  3. Make sure the CIM Object Manager is running.

    The installation starts the CIM Object Manager. If it is not running, see "Restarting the CIM Object Manager".

  4. Compile the Native_Example.mof file. For example:

    % mofcomp Native_Example.mof
    

    Compiling this MOF file loads the Native_Example class in the CIM Object Manager and identifies NativeProvider as its provider.

  5. Run CIM WorkShop and view the Native_Example class. For example:

    % /opt/SUNWconn/wbem/bin/cimworkshop &
    

  6. In the Toolbar, click the Find Class icon.

  7. In the Input dialog box, type Native_Example and click OK.