Sun WBEM SDK Developer's Guide

Provider Example Files

The following table describes the files that make up the example Provider program.

Table 7–2 Provider Example Files

File 

Purpose 

NativeProvider

Top level provider program that fulfills requests from the CIM Object Manager and routes them to the Native_Example provider. The NativeProvider program implements the instanceProvider and methodProvider APIs, and declares methods that enumerate instances and get an instance of the Native_Example class. It also declares a method that invokes a method to print the string "Hello World."

Native_Example.mof

Creates a class that registers the NativeProvider provider with the CIM Object Manager. The Native_Example.mof file identifies NativeProvider as the provider to service requests for dynamic data in the Native_Example class. This MOF file also declares the properties and methods to be implemented by the NativeProvider.

Native_Example.java

The NativeProvider program calls this provider to implement methods that enumerate instances and get an instance of the Native_Example class. The Native_Example provider uses the APIs to enumerate objects and create instances of objects. The Native_Example class declares native methods, which call C functions in the native.c file to get system-specific values, such as host name, serial number, release, machine, architecture, and manufacturer.

native.c

C program that implements calls from the Native_Example Java provider in native C code.

Native_Example.h

Machine-generated header file for Native_Example class. Defines the correspondence between the Java native method names and the native C functions that execute those methods.

libnative.so

Binary native C code compiled from the native.c file.