version 1.4, 2010/11/02 05:27:58
|
version 1.4.2.5, 2014/03/14 17:30:21
|
|
|
#include <Pegasus/Common/AutoPtr.h> | #include <Pegasus/Common/AutoPtr.h> |
#include <Pegasus/Common/ArrayInternal.h> | #include <Pegasus/Common/ArrayInternal.h> |
#include <Pegasus/Common/CIMMessage.h> | #include <Pegasus/Common/CIMMessage.h> |
#include <Pegasus/Common/CIMMessageSerializer.h> |
|
#include <Pegasus/Common/CIMMessageDeserializer.h> |
|
#include <Pegasus/Common/OperationContextInternal.h> | #include <Pegasus/Common/OperationContextInternal.h> |
#include <Pegasus/Common/System.h> | #include <Pegasus/Common/System.h> |
#include <Pegasus/Common/AnonymousPipe.h> | #include <Pegasus/Common/AnonymousPipe.h> |
|
|
PEGASUS_PROVIDERMODULEGROUPFAIL_CALLBACK_T | PEGASUS_PROVIDERMODULEGROUPFAIL_CALLBACK_T |
providerModuleGroupFailCallback, | providerModuleGroupFailCallback, |
PEGASUS_ASYNC_RESPONSE_CALLBACK_T asyncResponseCallback, | PEGASUS_ASYNC_RESPONSE_CALLBACK_T asyncResponseCallback, |
Boolean subscriptionInitComplete, |
|
ThreadPool * threadPool); | ThreadPool * threadPool); |
| |
~ProviderAgentContainer(); | ~ProviderAgentContainer(); |
|
|
intervals along with unloadIdleProviders | intervals along with unloadIdleProviders |
*/ | */ |
void cleanDisconnectedClientRequests(); | void cleanDisconnectedClientRequests(); |
|
static void setAllProvidersStopped(); |
|
static void setSubscriptionInitComplete(Boolean value); |
|
void sendResponse(CIMResponseMessage *response); |
private: | private: |
// | // |
// Private methods | // Private methods |
|
|
For more information, please see the description of the | For more information, please see the description of the |
ProviderManagerRouter::_subscriptionInitComplete member variable. | ProviderManagerRouter::_subscriptionInitComplete member variable. |
*/ | */ |
Boolean _subscriptionInitComplete; |
static Boolean _subscriptionInitComplete; |
| |
| |
/** | /** |
|
|
*/ | */ |
ThreadPool* _threadPool; | ThreadPool* _threadPool; |
| |
|
static Boolean _allProvidersStopped; |
}; | }; |
| |
Uint32 ProviderAgentContainer::_numProviderProcesses = 0; | Uint32 ProviderAgentContainer::_numProviderProcesses = 0; |
Mutex ProviderAgentContainer::_numProviderProcessesMutex; | Mutex ProviderAgentContainer::_numProviderProcessesMutex; |
|
Boolean ProviderAgentContainer::_allProvidersStopped = false; |
|
Boolean ProviderAgentContainer::_subscriptionInitComplete = false; |
| |
// Set this to a value that no valid CIMResponseMessage* will have. | // Set this to a value that no valid CIMResponseMessage* will have. |
CIMResponseMessage* ProviderAgentContainer::_REQUEST_NOT_PROCESSED = | CIMResponseMessage* ProviderAgentContainer::_REQUEST_NOT_PROCESSED = |
|
|
PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback, | PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback, |
PEGASUS_PROVIDERMODULEGROUPFAIL_CALLBACK_T providerModuleGroupFailCallback, | PEGASUS_PROVIDERMODULEGROUPFAIL_CALLBACK_T providerModuleGroupFailCallback, |
PEGASUS_ASYNC_RESPONSE_CALLBACK_T asyncResponseCallback, | PEGASUS_ASYNC_RESPONSE_CALLBACK_T asyncResponseCallback, |
Boolean subscriptionInitComplete, |
|
ThreadPool* threadPool) | ThreadPool* threadPool) |
: | : |
_bitness(bitness), | _bitness(bitness), |
|
|
_providerModuleGroupFailCallback(providerModuleGroupFailCallback), | _providerModuleGroupFailCallback(providerModuleGroupFailCallback), |
_asyncResponseCallback(asyncResponseCallback), | _asyncResponseCallback(asyncResponseCallback), |
_isInitialized(false), | _isInitialized(false), |
_subscriptionInitComplete(subscriptionInitComplete), |
|
_threadPool(threadPool) | _threadPool(threadPool) |
{ | { |
PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, | PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, |
|
|
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
} | } |
| |
|
void ProviderAgentContainer::setAllProvidersStopped() |
|
{ |
|
_allProvidersStopped = true; |
|
} |
|
|
|
void ProviderAgentContainer::setSubscriptionInitComplete(Boolean value) |
|
{ |
|
_subscriptionInitComplete = value; |
|
} |
|
|
void ProviderAgentContainer::_startAgentProcess() | void ProviderAgentContainer::_startAgentProcess() |
{ | { |
PEG_METHOD_ENTER( | PEG_METHOD_ENTER( |
|
|
v); | v); |
Uint32 maxProviderProcesses = (Uint32)v; | Uint32 maxProviderProcesses = (Uint32)v; |
| |
char* end = 0; |
|
|
|
{ | { |
AutoMutex lock(_numProviderProcessesMutex); | AutoMutex lock(_numProviderProcessesMutex); |
| |
|
|
| |
try | try |
{ | { |
|
CIMException cimException; |
|
if (!cleanShutdown) |
|
{ |
|
cimException = PEGASUS_CIM_EXCEPTION( |
|
CIM_ERR_FAILED, |
|
MessageLoaderParms( |
|
"ProviderManager.OOPProviderManagerRouter." |
|
"CIMPROVAGT_CONNECTION_LOST", |
|
"Lost connection with cimprovagt \"$0\".", |
|
_moduleOrGroupName)); |
|
} |
|
|
AutoMutex lock(_agentMutex); | AutoMutex lock(_agentMutex); |
| |
PEGASUS_ASSERT(_isInitialized); | PEGASUS_ASSERT(_isInitialized); |
|
|
i != 0; i++) | i != 0; i++) |
{ | { |
Boolean sendResponseNow = false; | Boolean sendResponseNow = false; |
CIMResponseMessage *response; |
CIMResponseMessage *response = 0; |
| |
if(cleanShutdown) |
|
{ |
|
MessageType msgType = i.value()->requestMessage->getType(); | MessageType msgType = i.value()->requestMessage->getType(); |
| |
|
// Note: Whether this agent was shutdown cleanly or not, |
|
// for the below requests wait until all responses are |
|
// received. |
if(msgType == CIM_STOP_ALL_PROVIDERS_REQUEST_MESSAGE || | if(msgType == CIM_STOP_ALL_PROVIDERS_REQUEST_MESSAGE || |
msgType == CIM_NOTIFY_CONFIG_CHANGE_REQUEST_MESSAGE || | msgType == CIM_NOTIFY_CONFIG_CHANGE_REQUEST_MESSAGE || |
msgType == | msgType == |
CIM_SUBSCRIPTION_INIT_COMPLETE_REQUEST_MESSAGE || | CIM_SUBSCRIPTION_INIT_COMPLETE_REQUEST_MESSAGE || |
msgType == | msgType == |
CIM_INDICATION_SERVICE_DISABLED_REQUEST_MESSAGE || | CIM_INDICATION_SERVICE_DISABLED_REQUEST_MESSAGE || |
msgType == CIM_DELETE_SUBSCRIPTION_REQUEST_MESSAGE) |
msgType == CIM_ENABLE_MODULE_REQUEST_MESSAGE || |
|
msgType == CIM_DISABLE_MODULE_REQUEST_MESSAGE) |
|
{ |
|
PEGASUS_ASSERT(i.value()->respAggregator); |
|
if(i.value()->respAggregator->isComplete(cimException)) |
|
{ |
|
CIMException cimException; |
|
sendResponseNow = true; |
|
|
|
if (msgType == CIM_ENABLE_MODULE_REQUEST_MESSAGE || |
|
msgType == CIM_DISABLE_MODULE_REQUEST_MESSAGE) |
|
{ |
|
CIMException e = |
|
i.value()->respAggregator->getException(); |
|
if (e.getCode() == CIM_ERR_SUCCESS) |
|
{ |
|
retryReqArray.append(i.value()->requestMessage); |
|
sendResponseNow = false; |
|
} |
|
else |
{ | { |
CIMException ce; |
cimException = e; |
if(i.value()->respAggregator == NULL || |
} |
i.value()->respAggregator->isComplete(ce)) |
} |
|
|
|
if (sendResponseNow) |
{ | { |
response = | response = |
i.value()->requestMessage->buildResponse(); | i.value()->requestMessage->buildResponse(); |
response->messageId = i.value()->originalMessageId; | response->messageId = i.value()->originalMessageId; |
response->cimException = ce; |
response->cimException = cimException; |
sendResponseNow = true; | sendResponseNow = true; |
} | } |
|
delete i.value()->respAggregator; |
|
} |
} | } |
else |
else if (msgType == CIM_DELETE_SUBSCRIPTION_REQUEST_MESSAGE) |
|
{ |
|
response = i.value()->requestMessage->buildResponse(); |
|
response->messageId = i.value()->originalMessageId; |
|
sendResponseNow = true; |
|
} |
|
else if (cleanShutdown) |
{ | { |
// retry the request | // retry the request |
retryReqArray.append(i.value()->requestMessage); | retryReqArray.append(i.value()->requestMessage); |
} | } |
} |
|
else | else |
{ | { |
|
// Requests with respAggregator set were already handled |
|
// before. |
|
PEGASUS_ASSERT(!i.value()->respAggregator); |
response = i.value()->requestMessage->buildResponse(); | response = i.value()->requestMessage->buildResponse(); |
response->cimException = PEGASUS_CIM_EXCEPTION( |
response->cimException = cimException; |
CIM_ERR_FAILED, |
|
MessageLoaderParms( |
|
"ProviderManager.OOPProviderManagerRouter." |
|
"CIMPROVAGT_CONNECTION_LOST", |
|
"Lost connection with cimprovagt \"$0\".", |
|
_moduleOrGroupName)); |
|
sendResponseNow = true; | sendResponseNow = true; |
} | } |
| |
|
|
i.value()->requestMessage, | i.value()->requestMessage, |
response); | response); |
} | } |
// delete the response aggregator |
|
delete i.value()->respAggregator; |
|
} | } |
_outstandingRequestTable.clear(); | _outstandingRequestTable.clear(); |
} | } |
|
|
CIM_ERR_FAILED, | CIM_ERR_FAILED, |
MessageLoaderParms("ProviderManager." | MessageLoaderParms("ProviderManager." |
"OOPProviderManagerRouter." | "OOPProviderManagerRouter." |
"REQUEST_RETRY_THREAD_" |
"REQUEST_RETRY_THREAD_ALLOCATION_FAILED", |
"ALLOCATION_FAILED", |
|
"Failed to allocate a thread to " | "Failed to allocate a thread to " |
"retry a request in \"$0\".", | "retry a request in \"$0\".", |
_moduleOrGroupName)); | _moduleOrGroupName)); |
|
|
return _groupNameWithType; | return _groupNameWithType; |
} | } |
| |
|
void ProviderAgentContainer::sendResponse(CIMResponseMessage *response) |
|
{ |
|
AutoMutex lock(_agentMutex); |
|
|
|
AnonymousPipe::Status writeStatus = |
|
_pipeToAgent->writeMessage(response); |
|
if (writeStatus != AnonymousPipe::STATUS_SUCCESS) |
|
{ |
|
PEG_TRACE((TRC_PROVIDERMANAGER, Tracer::LEVEL1, |
|
"Failed to write message to pipe. writeStatus = %d.", |
|
writeStatus)); |
|
} |
|
delete response; |
|
} |
|
|
CIMResponseMessage* ProviderAgentContainer::processMessage( | CIMResponseMessage* ProviderAgentContainer::processMessage( |
CIMRequestMessage* request,RespAggCounter* respAggregator) | CIMRequestMessage* request,RespAggCounter* respAggregator) |
{ | { |
|
|
if (response == _REQUEST_NOT_PROCESSED) | if (response == _REQUEST_NOT_PROCESSED) |
{ | { |
// Check for request message types that should not be retried. | // Check for request message types that should not be retried. |
if ((request->getType() == |
if ((msgType == CIM_STOP_ALL_PROVIDERS_REQUEST_MESSAGE) || |
CIM_STOP_ALL_PROVIDERS_REQUEST_MESSAGE) || |
(msgType == CIM_NOTIFY_CONFIG_CHANGE_REQUEST_MESSAGE) || |
(request->getType() == |
(msgType == CIM_SUBSCRIPTION_INIT_COMPLETE_REQUEST_MESSAGE) || |
CIM_NOTIFY_CONFIG_CHANGE_REQUEST_MESSAGE) || |
(msgType == CIM_INDICATION_SERVICE_DISABLED_REQUEST_MESSAGE) || |
(request->getType() == |
(msgType == CIM_DELETE_SUBSCRIPTION_REQUEST_MESSAGE)) |
CIM_SUBSCRIPTION_INIT_COMPLETE_REQUEST_MESSAGE) || |
|
(request->getType() == |
|
CIM_INDICATION_SERVICE_DISABLED_REQUEST_MESSAGE) || |
|
(request->getType() == |
|
CIM_DELETE_SUBSCRIPTION_REQUEST_MESSAGE)) |
|
{ | { |
response = request->buildResponse(); | response = request->buildResponse(); |
break; | break; |
} | } |
else if (request->getType() == CIM_DISABLE_MODULE_REQUEST_MESSAGE) |
else if (msgType == CIM_DISABLE_MODULE_REQUEST_MESSAGE) |
{ | { |
response = request->buildResponse(); | response = request->buildResponse(); |
CIMDisableModuleResponseMessage* dmResponse = | CIMDisableModuleResponseMessage* dmResponse = |
|
|
} | } |
} while (response == _REQUEST_NOT_PROCESSED); | } while (response == _REQUEST_NOT_PROCESSED); |
| |
if (msgType == CIM_SUBSCRIPTION_INIT_COMPLETE_REQUEST_MESSAGE) |
|
{ |
|
_subscriptionInitComplete = true; |
|
} |
|
else if (msgType == |
|
CIM_INDICATION_SERVICE_DISABLED_REQUEST_MESSAGE) |
|
{ |
|
_subscriptionInitComplete = false; |
|
} |
|
|
|
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
return response; | return response; |
} | } |
|
|
sprintf(messagePtrString, "%p", request); | sprintf(messagePtrString, "%p", request); |
String uniqueMessageId = messagePtrString; | String uniqueMessageId = messagePtrString; |
| |
|
// Trace to relate request messageId to provider internal messageId |
|
PEG_TRACE((TRC_PROVIDERMANAGER, Tracer::LEVEL3, |
|
"ProviderAgentContainer, request message ID %s " |
|
"provider internal messageId %s", |
|
(const char*)request->messageId.getCString(), |
|
messagePtrString )); |
// | // |
// Set up the OutstandingRequestEntry for this request | // Set up the OutstandingRequestEntry for this request |
// | // |
|
|
{ | { |
AutoMutex lock(_agentMutex); | AutoMutex lock(_agentMutex); |
| |
|
// Don't process any other messages if _allProvidersStopped flag |
|
// is set. CIMServer hangs during the shutdown if the agent is |
|
// started to process a request after StopAllProviders request |
|
// has been processed. This scenario may happen if provider |
|
// generates indication during the shutdwon whose destination is |
|
// indication consumer provider running within cimserver. |
|
if (_allProvidersStopped && |
|
request->getType() != CIM_STOP_ALL_PROVIDERS_REQUEST_MESSAGE) |
|
{ |
|
//Note: l11n is not necessary, not propagated to client. |
|
CIMException e = CIMException( |
|
CIM_ERR_FAILED, |
|
"Request not processed, CIMServer shutting down"); |
|
if (!respAggregator || respAggregator->isComplete(e)) |
|
{ |
|
|
|
PEG_TRACE((TRC_PROVIDERMANAGER, Tracer::LEVEL1, |
|
"Exception: %s", |
|
(const char*)e.getMessage().getCString())); |
|
response = request->buildResponse(); |
|
delete respAggregator; |
|
PEG_METHOD_EXIT(); |
|
return response; |
|
} |
|
} |
|
|
// | // |
// Initialize the Provider Agent, if necessary | // Initialize the Provider Agent, if necessary |
// | // |
|
|
origProviderId.reset(new ProviderIdContainer( | origProviderId.reset(new ProviderIdContainer( |
pidc.getModule(), pidc.getProvider(), | pidc.getModule(), pidc.getProvider(), |
pidc.isRemoteNameSpace(), pidc.getRemoteInfo())); | pidc.isRemoteNameSpace(), pidc.getRemoteInfo())); |
|
origProviderId->setProvMgrPath(pidc.getProvMgrPath()); |
if (_providerModuleCache.isUninitialized() || | if (_providerModuleCache.isUninitialized() || |
(!pidc.getModule().identical(_providerModuleCache))) | (!pidc.getModule().identical(_providerModuleCache))) |
{ | { |
|
|
try | try |
{ | { |
PEG_TRACE((TRC_PROVIDERMANAGER, Tracer::LEVEL3, | PEG_TRACE((TRC_PROVIDERMANAGER, Tracer::LEVEL3, |
"Sending request to agent with messageId %s", |
"Sending request to agent, " |
|
"messageId %s internal messageId %s", |
|
(const char*)request->messageId.getCString(), |
(const char*)uniqueMessageId.getCString())); | (const char*)uniqueMessageId.getCString())); |
| |
request->messageId = uniqueMessageId; | request->messageId = uniqueMessageId; |
|
|
// Remove this OutstandingRequestTable entry | // Remove this OutstandingRequestTable entry |
{ | { |
AutoMutex tableLock(_outstandingRequestTableMutex); | AutoMutex tableLock(_outstandingRequestTableMutex); |
Boolean removed = |
PEGASUS_FCT_EXECUTE_AND_ASSERT( |
_outstandingRequestTable.remove(uniqueMessageId); |
true, |
PEGASUS_ASSERT(removed); |
_outstandingRequestTable.remove(uniqueMessageId)); |
} | } |
| |
// A response value of _REQUEST_NOT_PROCESSED indicates | // A response value of _REQUEST_NOT_PROCESSED indicates |
|
|
// Remove the OutstandingRequestTable entry for this request | // Remove the OutstandingRequestTable entry for this request |
{ | { |
AutoMutex tableLock(_outstandingRequestTableMutex); | AutoMutex tableLock(_outstandingRequestTableMutex); |
Boolean removed = |
PEGASUS_FCT_EXECUTE_AND_ASSERT( |
_outstandingRequestTable.remove(uniqueMessageId); |
true, |
PEGASUS_ASSERT(removed); |
_outstandingRequestTable.remove(uniqueMessageId)); |
} | } |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
throw; | throw; |
|
|
| |
AutoPtr<ProvAgtGetScmoClassResponseMessage> response( | AutoPtr<ProvAgtGetScmoClassResponseMessage> response( |
new ProvAgtGetScmoClassResponseMessage( | new ProvAgtGetScmoClassResponseMessage( |
XmlWriter::getNextMessageId(), |
request->messageId, |
CIMException(), | CIMException(), |
QueueIdStack(), | QueueIdStack(), |
SCMOClass("",""))); | SCMOClass("",""))); |
|
|
if (message->getType() == CIM_PROCESS_INDICATION_REQUEST_MESSAGE) | if (message->getType() == CIM_PROCESS_INDICATION_REQUEST_MESSAGE) |
{ | { |
// Process an indication message | // Process an indication message |
|
CIMProcessIndicationRequestMessage* request = |
_indicationCallback( |
|
reinterpret_cast<CIMProcessIndicationRequestMessage*>( | reinterpret_cast<CIMProcessIndicationRequestMessage*>( |
message)); |
message); |
|
request->oopAgentName = getGroupNameWithType(); |
|
_indicationCallback(request); |
} | } |
else if (message->getType()==PROVAGT_GET_SCMOCLASS_REQUEST_MESSAGE) | else if (message->getType()==PROVAGT_GET_SCMOCLASS_REQUEST_MESSAGE) |
{ | { |
|
|
if(foundEntry) | if(foundEntry) |
{ | { |
// Remove the completed request from the table | // Remove the completed request from the table |
Boolean removed = _outstandingRequestTable.remove( \ |
PEGASUS_FCT_EXECUTE_AND_ASSERT( |
response->messageId); |
true, |
PEGASUS_ASSERT(removed); |
_outstandingRequestTable.remove( |
|
response->messageId)); |
} | } |
| |
} | } |
|
|
_responseChunkCallback = responseChunkCallback; | _responseChunkCallback = responseChunkCallback; |
_providerModuleGroupFailCallback = providerModuleGroupFailCallback; | _providerModuleGroupFailCallback = providerModuleGroupFailCallback; |
_asyncResponseCallback = asyncResponseCallback; | _asyncResponseCallback = asyncResponseCallback; |
_subscriptionInitComplete = false; |
|
_threadPool = | _threadPool = |
new ThreadPool(0, "OOPProviderManagerRouter", 0, 0, deallocateWait);; | new ThreadPool(0, "OOPProviderManagerRouter", 0, 0, deallocateWait);; |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
|
|
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
} | } |
| |
|
void OOPProviderManagerRouter::_handleIndicationDeliveryResponse( |
|
CIMResponseMessage *response) |
|
{ |
|
if (response->getType() == CIM_PROCESS_INDICATION_RESPONSE_MESSAGE) |
|
{ |
|
CIMProcessIndicationResponseMessage *rsp = |
|
(CIMProcessIndicationResponseMessage*)response; |
|
|
|
// Look up the Provider Agents for this module |
|
Array<ProviderAgentContainer*> paArray = |
|
_lookupProviderAgents(rsp->oopAgentName); |
|
|
|
for (Uint32 i = 0; i < paArray.size(); i++) |
|
{ |
|
if (paArray[i]->isInitialized()) |
|
{ |
|
paArray[i]->sendResponse(response); |
|
} |
|
} |
|
return; |
|
} |
|
|
|
PEGASUS_UNREACHABLE(PEGASUS_ASSERT(false);) |
|
} |
|
|
Message* OOPProviderManagerRouter::processMessage(Message* message) | Message* OOPProviderManagerRouter::processMessage(Message* message) |
{ | { |
PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, | PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, |
"OOPProviderManagerRouter::processMessage"); | "OOPProviderManagerRouter::processMessage"); |
| |
|
if (message->getType() == CIM_PROCESS_INDICATION_RESPONSE_MESSAGE) |
|
{ |
|
_handleIndicationDeliveryResponse((CIMResponseMessage*)message); |
|
return 0; |
|
} |
|
|
CIMRequestMessage* request = dynamic_cast<CIMRequestMessage *>(message); | CIMRequestMessage* request = dynamic_cast<CIMRequestMessage *>(message); |
PEGASUS_ASSERT(request != 0); | PEGASUS_ASSERT(request != 0); |
| |
|
|
// | // |
if (request->getType() == CIM_STOP_ALL_PROVIDERS_REQUEST_MESSAGE) | if (request->getType() == CIM_STOP_ALL_PROVIDERS_REQUEST_MESSAGE) |
{ | { |
|
ProviderAgentContainer::setAllProvidersStopped(); |
// Forward the CIMStopAllProvidersRequest to all providers | // Forward the CIMStopAllProvidersRequest to all providers |
response.reset(_forwardRequestToAllAgents(request)); | response.reset(_forwardRequestToAllAgents(request)); |
| |
|
|
else if (request->getType () == | else if (request->getType () == |
CIM_SUBSCRIPTION_INIT_COMPLETE_REQUEST_MESSAGE) | CIM_SUBSCRIPTION_INIT_COMPLETE_REQUEST_MESSAGE) |
{ | { |
_subscriptionInitComplete = true; |
ProviderAgentContainer::setSubscriptionInitComplete(true); |
| |
// | // |
// Forward the CIMSubscriptionInitCompleteRequestMessage to | // Forward the CIMSubscriptionInitCompleteRequestMessage to |
|
|
else if (request->getType () == | else if (request->getType () == |
CIM_INDICATION_SERVICE_DISABLED_REQUEST_MESSAGE) | CIM_INDICATION_SERVICE_DISABLED_REQUEST_MESSAGE) |
{ | { |
_subscriptionInitComplete = false; |
ProviderAgentContainer::setSubscriptionInitComplete(false); |
| |
// | // |
// Forward the CIMIndicationServiceDisabledRequestMessage to | // Forward the CIMIndicationServiceDisabledRequestMessage to |
|
|
_indicationCallback, _responseChunkCallback, | _indicationCallback, _responseChunkCallback, |
_providerModuleGroupFailCallback, | _providerModuleGroupFailCallback, |
_asyncResponseCallback, | _asyncResponseCallback, |
_subscriptionInitComplete, |
|
_threadPool); | _threadPool); |
_providerAgentTable.insert(key, pa); | _providerAgentTable.insert(key, pa); |
} | } |
|
|
return paArray; | return paArray; |
} | } |
| |
CIMResponseMessage* OOPProviderManagerRouter::_forwardRequestToAllAgents( |
Array<ProviderAgentContainer*> |
CIMRequestMessage* request) |
OOPProviderManagerRouter::_getProviderAgentContainerCopy() |
{ | { |
PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, |
|
"OOPProviderManagerRouter::_forwardRequestToAllAgents"); |
|
|
|
// Get a list of the ProviderAgentContainers. We need our own array copy |
|
// because we cannot hold the _providerAgentTableMutex while calling |
|
// _ProviderAgentContainer::processMessage(). |
|
Array<ProviderAgentContainer*> paContainerArray; | Array<ProviderAgentContainer*> paContainerArray; |
{ |
|
AutoMutex tableLock(_providerAgentTableMutex); | AutoMutex tableLock(_providerAgentTableMutex); |
|
|
for (ProviderAgentTable::Iterator i = _providerAgentTable.start(); | for (ProviderAgentTable::Iterator i = _providerAgentTable.start(); |
i != 0; i++) | i != 0; i++) |
{ | { |
|
|
paContainerArray.append(i.value()); | paContainerArray.append(i.value()); |
} | } |
} | } |
|
return paContainerArray; |
} | } |
| |
|
CIMResponseMessage* OOPProviderManagerRouter::_forwardRequestToAllAgents( |
|
CIMRequestMessage* request) |
|
{ |
|
PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, |
|
"OOPProviderManagerRouter::_forwardRequestToAllAgents"); |
|
|
|
// Get a list of the ProviderAgentContainers. We need our own array copy |
|
// because we cannot hold the _providerAgentTableMutex while calling |
|
// _ProviderAgentContainer::processMessage(). |
|
Array<ProviderAgentContainer*> paContainerArray= |
|
_getProviderAgentContainerCopy(); |
|
|
Boolean responsePending = false; | Boolean responsePending = false; |
CIMResponseMessage *response = request->buildResponse(); | CIMResponseMessage *response = request->buildResponse(); |
| |
|
|
// because we cannot hold the _providerAgentTableMutex while calling | // because we cannot hold the _providerAgentTableMutex while calling |
// ProviderAgentContainer::unloadIdleProviders() & | // ProviderAgentContainer::unloadIdleProviders() & |
// ProviderAgentContainer::cleanDisconnectedClientRequests(). | // ProviderAgentContainer::cleanDisconnectedClientRequests(). |
Array<ProviderAgentContainer*> paContainerArray; |
Array<ProviderAgentContainer*> paContainerArray= |
{ |
_getProviderAgentContainerCopy(); |
AutoMutex tableLock(_providerAgentTableMutex); |
|
for (ProviderAgentTable::Iterator i = _providerAgentTable.start(); |
|
i != 0; i++) |
|
{ |
|
paContainerArray.append(i.value()); |
|
} |
|
} |
|
| |
// Iterate through the _providerAgentTable unloading idle providers | // Iterate through the _providerAgentTable unloading idle providers |
for (Uint32 j = 0; j < paContainerArray.size(); j++) | for (Uint32 j = 0; j < paContainerArray.size(); j++) |