HP WBEM Services Software Developer's Kit for HP-UX Provider and Client Developer's Guide A.01
Provider Implementation
Provider Design Considerations
Chapter 4 59
extern "C" CIMProvider *
PegasusCreateProvider(const String &providerName)
{
// create new provider instance on heap and return its
// address. will require the provider's terminate() function
// to use "delete this;" to deallocate
if String::equalNoCase( providerName, "ProcessStatusProvider" )
return new ProcessStatusProvider;
if String::equalNoCase( providerName, "MemoryInfoProvider" )
return new MemoryInfoProvider;
// If neither name was recognized, there could be an
// error in a registration instance
return 0;
}
Example 4-5 PG_Provider: A MOF showing an instance
instance of PG_Provider
{
// Properties inherited from CIM_ManagedElement
Caption = "Process Status Provider"; //not required
Description = "Instruments several classes in the
"CIM_LogicalElement"; //not required
// Properties inherited from CIM_ManagedSystemElement
InstallDATE = “20020517140341.000000-420”; // not required
// Properties local to PG_Provider
ProviderModuleName = "DynamicInfoModule"; // required
Name = "ProcessStatusProvider"; // required
};
In Example 4.5, the instance of PG_Provider informs the CIM Server
that the provider named ProcessStatusProvider will be found in the
Provider Module named DynamicInfoModule. For our example, there
would be another instance of PG_Provider to tell the CIM Server that
the MemoryInfoProvider is also in the DynamicInfoModule.