version 1.10, 2005/02/08 22:39:32
|
version 1.15, 2005/02/27 04:10:53
|
|
|
// Jenny Yu, Hewlett-Packard Company (jenny_yu@hp.com) | // Jenny Yu, Hewlett-Packard Company (jenny_yu@hp.com) |
// | // |
// Modified By: Sean Keenan, Hewlett-Packard Company (sean.keenan@hp.com) | // Modified By: Sean Keenan, Hewlett-Packard Company (sean.keenan@hp.com) |
|
// Carol Ann Krug Graves, Hewlett-Packard Company |
|
// (carolann_graves@hp.com) |
// | // |
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
|
|
ProviderAgentContainer( | ProviderAgentContainer( |
const String & moduleName, | const String & moduleName, |
const String & userName, | const String & userName, |
PEGASUS_INDICATION_CALLBACK indicationCallback); |
PEGASUS_INDICATION_CALLBACK indicationCallback, |
|
Boolean subscriptionInitComplete); |
| |
~ProviderAgentContainer(); | ~ProviderAgentContainer(); |
| |
|
|
(active) at one time. | (active) at one time. |
*/ | */ |
static Uint32 _maxProviderProcesses; | static Uint32 _maxProviderProcesses; |
|
|
|
/** |
|
Indicates whether the Indication Service has completed initialization. |
|
|
|
For more information, please see the description of the |
|
ProviderManagerRouter::_subscriptionInitComplete member variable. |
|
*/ |
|
Boolean _subscriptionInitComplete; |
}; | }; |
| |
Uint32 ProviderAgentContainer::_numProviderProcesses = 0; | Uint32 ProviderAgentContainer::_numProviderProcesses = 0; |
|
|
ProviderAgentContainer::ProviderAgentContainer( | ProviderAgentContainer::ProviderAgentContainer( |
const String & moduleName, | const String & moduleName, |
const String & userName, | const String & userName, |
PEGASUS_INDICATION_CALLBACK indicationCallback) |
PEGASUS_INDICATION_CALLBACK indicationCallback, |
|
Boolean subscriptionInitComplete) |
: _moduleName(moduleName), | : _moduleName(moduleName), |
_userName(userName), | _userName(userName), |
_indicationCallback(indicationCallback), | _indicationCallback(indicationCallback), |
_isInitialized(false) |
_isInitialized(false), |
|
_subscriptionInitComplete(subscriptionInitComplete) |
{ | { |
PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, | PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, |
"ProviderAgentContainer::ProviderAgentContainer"); | "ProviderAgentContainer::ProviderAgentContainer"); |
|
|
pipeToAgent->exportReadHandle(readHandle); | pipeToAgent->exportReadHandle(readHandle); |
pipeFromAgent->exportWriteHandle(writeHandle); | pipeFromAgent->exportWriteHandle(writeHandle); |
| |
|
#ifndef PEGASUS_DISABLE_PROV_USERCTXT |
// Set the user context of the Provider Agent process | // Set the user context of the Provider Agent process |
if (_userName != System::getEffectiveUserName()) | if (_userName != System::getEffectiveUserName()) |
{ | { |
|
|
_exit(1); | _exit(1); |
} | } |
} | } |
|
#endif |
| |
execl(agentCommandPathCString, agentCommandPathCString, | execl(agentCommandPathCString, agentCommandPathCString, |
readHandle, writeHandle, | readHandle, writeHandle, |
|
|
_pipeToAgent.reset(pipeToAgent.release()); | _pipeToAgent.reset(pipeToAgent.release()); |
_pipeFromAgent.reset(pipeFromAgent.release()); | _pipeFromAgent.reset(pipeFromAgent.release()); |
| |
#if defined (PEGASUS_OS_VMS) |
|
// |
|
// Denote end of switch |
|
// |
|
} |
|
#endif |
|
|
|
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
} | } |
| |
|
|
configManager->getPegasusHome(), | configManager->getPegasusHome(), |
configProperties, | configProperties, |
System::bindVerbose, | System::bindVerbose, |
|
_subscriptionInitComplete, |
QueueIdStack())); | QueueIdStack())); |
| |
// | // |
|
|
} | } |
} | } |
| |
PEG_METHOD_EXIT(); |
|
} | } |
| |
PEGASUS_THREAD_RETURN PEGASUS_THREAD_CDECL | PEGASUS_THREAD_RETURN PEGASUS_THREAD_CDECL |
|
|
"OOPProviderManagerRouter::OOPProviderManagerRouter"); | "OOPProviderManagerRouter::OOPProviderManagerRouter"); |
| |
_indicationCallback = indicationCallback; | _indicationCallback = indicationCallback; |
|
_subscriptionInitComplete = false; |
| |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
} | } |
|
|
providerModule = dmReq->providerModule; | providerModule = dmReq->providerModule; |
} | } |
else if ((request->getType() == CIM_STOP_ALL_PROVIDERS_REQUEST_MESSAGE) || | else if ((request->getType() == CIM_STOP_ALL_PROVIDERS_REQUEST_MESSAGE) || |
|
(request->getType() == |
|
CIM_SUBSCRIPTION_INIT_COMPLETE_REQUEST_MESSAGE) || |
(request->getType() == CIM_NOTIFY_CONFIG_CHANGE_REQUEST_MESSAGE)) | (request->getType() == CIM_NOTIFY_CONFIG_CHANGE_REQUEST_MESSAGE)) |
{ | { |
// This operation is not provider-specific | // This operation is not provider-specific |
|
|
// Just let the selecting thread notice when the agent connections | // Just let the selecting thread notice when the agent connections |
// are closed. | // are closed. |
} | } |
|
else if (request->getType () == |
|
CIM_SUBSCRIPTION_INIT_COMPLETE_REQUEST_MESSAGE) |
|
{ |
|
_subscriptionInitComplete = true; |
|
|
|
// |
|
// Forward the CIMSubscriptionInitCompleteRequestMessage to |
|
// all providers |
|
// |
|
response.reset (_forwardRequestToAllAgents (request)); |
|
} |
else if (request->getType() == CIM_NOTIFY_CONFIG_CHANGE_REQUEST_MESSAGE) | else if (request->getType() == CIM_NOTIFY_CONFIG_CHANGE_REQUEST_MESSAGE) |
{ | { |
CIMNotifyConfigChangeRequestMessage* notifyRequest = | CIMNotifyConfigChangeRequestMessage* notifyRequest = |
|
|
PEGASUS_PROPERTYNAME_MODULE_USERCONTEXT); | PEGASUS_PROPERTYNAME_MODULE_USERCONTEXT); |
if (pos != PEG_NOT_FOUND) | if (pos != PEG_NOT_FOUND) |
{ | { |
providerModule.getProperty(pos).getValue().get(userContext); |
CIMValue userContextValue = |
|
providerModule.getProperty(pos).getValue(); |
|
if (!userContextValue.isNull()) |
|
{ |
|
userContextValue.get(userContext); |
|
} |
} | } |
| |
if (userContext == 0) | if (userContext == 0) |
|
|
if (!_providerAgentTable.lookup(key, pa)) | if (!_providerAgentTable.lookup(key, pa)) |
{ | { |
pa = new ProviderAgentContainer( | pa = new ProviderAgentContainer( |
moduleName, userName, _indicationCallback); |
moduleName, userName, _indicationCallback, |
|
_subscriptionInitComplete); |
_providerAgentTable.insert(key, pa); | _providerAgentTable.insert(key, pa); |
} | } |
return pa; | return pa; |