version 1.1.2.2, 2008/07/17 19:46:23
|
version 1.1.2.3, 2008/09/24 23:34:11
|
|
|
| |
for (Symbol* p = rep->symbols; p; p = p->next) | for (Symbol* p = rep->symbols; p; p = p->next) |
{ | { |
|
if (p->name == name) |
|
return p->address; |
|
|
if (p->path == path && p->name == name) | if (p->path == path && p->name == name) |
return p->address; | return p->address; |
} | } |
|
|
const Uint32 EmbeddedServer::METHOD_PROVIDER_TYPE = 8; | const Uint32 EmbeddedServer::METHOD_PROVIDER_TYPE = 8; |
const Uint32 EmbeddedServer::INSTANCE_QUERY_PROVIDER_TYPE = 16; | const Uint32 EmbeddedServer::INSTANCE_QUERY_PROVIDER_TYPE = 16; |
| |
|
static Boolean _addSymbol( |
|
EmbeddedServerRep* rep, |
|
const String& path, |
|
const String& name, |
|
void* address) |
|
{ |
|
|
|
if (_lookupSymbolCallback(path.getCString(), name.getCString(), rep)) |
|
return false; |
|
|
|
Symbol* symbol = new Symbol; |
|
symbol->path = path; |
|
symbol->name = name; |
|
symbol->address = address; |
|
|
|
symbol->next = rep->symbols; |
|
rep->symbols = symbol; |
|
|
|
return true; |
|
} |
|
|
|
extern "C" class CIMHandler* PegasusCreateHandler(const String& handlerName); |
|
|
EmbeddedServer::EmbeddedServer() : _createdStaticProviderModule(false) | EmbeddedServer::EmbeddedServer() : _createdStaticProviderModule(false) |
{ | { |
// Initialize representation object: | // Initialize representation object: |
|
|
| |
pegasusAuthCallback = _authCallback; | pegasusAuthCallback = _authCallback; |
pegasusAuthData = this; | pegasusAuthData = this; |
|
|
|
_addSymbol(rep, "CIMXMLHandler", "PegasusCreateHandler", |
|
(void*)PegasusCreateHandler); |
} | } |
| |
EmbeddedServer::~EmbeddedServer() | EmbeddedServer::~EmbeddedServer() |
|
|
// Reject if repository is null at this point. | // Reject if repository is null at this point. |
| |
if (!rep->mrr) | if (!rep->mrr) |
|
{ |
|
printf("ZZZ1\n"); |
return false; | return false; |
|
} |
| |
// | // |
// Create instance of PG_ProviderModule: | // Create instance of PG_ProviderModule: |
|
|
ci.addProperty(CIMProperty("Name", moduleName)); | ci.addProperty(CIMProperty("Name", moduleName)); |
ci.addProperty(CIMProperty("Vendor", String("OpenPegasus"))); | ci.addProperty(CIMProperty("Vendor", String("OpenPegasus"))); |
| |
ci.addProperty(CIMProperty("Version", "2.6.0")); |
ci.addProperty(CIMProperty("Version", String("2.6.0"))); |
ci.addProperty(CIMProperty("InterfaceType", "C++Default")); |
ci.addProperty(CIMProperty("InterfaceType", String("C++Default"))); |
ci.addProperty(CIMProperty("InterfaceVersion", "2.6.0")); |
ci.addProperty(CIMProperty("InterfaceVersion", String("2.6.0"))); |
ci.addProperty(CIMProperty("Location", location)); | ci.addProperty(CIMProperty("Location", location)); |
| |
try | try |
|
|
return true; | return true; |
} | } |
| |
static Boolean _addSymbol( |
|
EmbeddedServerRep* rep, |
|
const String& path, |
|
const String& name, |
|
void* address) |
|
{ |
|
|
|
if (_lookupSymbolCallback(path.getCString(), name.getCString(), rep)) |
|
return false; |
|
|
|
Symbol* symbol = new Symbol; |
|
symbol->path = path; |
|
symbol->name = name; |
|
symbol->address = address; |
|
|
|
symbol->next = rep->symbols; |
|
rep->symbols = symbol; |
|
|
|
return true; |
|
} |
|
|
|
Boolean EmbeddedServer::registerPegasusProviderEntryPoint( | Boolean EmbeddedServer::registerPegasusProviderEntryPoint( |
const String& location, | const String& location, |
class CIMProvider* (*entryPoint)(const String&)) | class CIMProvider* (*entryPoint)(const String&)) |