version 1.54, 2004/06/29 23:42:54
|
version 1.58, 2004/08/27 23:24:26
|
|
|
return; | return; |
} | } |
| |
|
// Note: This method should not throw an exception. It is used as a thread |
|
// entry point, and any exceptions thrown are ignored. |
PEGASUS_THREAD_RETURN PEGASUS_THREAD_CDECL | PEGASUS_THREAD_RETURN PEGASUS_THREAD_CDECL |
ProviderManagerService::handleCimOperation(void * arg) throw() |
ProviderManagerService::handleCimOperation(void * arg) |
{ | { |
PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, | PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, |
"ProviderManagerService::handleCimOperation"); | "ProviderManagerService::handleCimOperation"); |
|
|
PEGASUS_ASSERT(async != 0); | PEGASUS_ASSERT(async != 0); |
| |
Message * response = 0; | Message * response = 0; |
|
Boolean consumerLookupFailed = false; |
if ((dynamic_cast<CIMOperationRequestMessage*>(request) != 0) || |
|
(dynamic_cast<CIMIndicationRequestMessage*>(request) != 0) || |
|
(request->getType() == CIM_EXPORT_INDICATION_REQUEST_MESSAGE) || |
|
(request->getType() == CIM_INITIALIZE_PROVIDER_REQUEST_MESSAGE)) |
|
{ |
|
// Handle CIMOperationRequestMessage, CIMExportIndicationRequestMessage, |
|
// CIMIndicationRequestMessage, and CIMInitializeProviderRequestMessage. |
|
// (These should be blocked when the provider module is disabled.) |
|
|
|
// |
|
// Get the provider module instance to check for a disabled module |
|
// |
|
CIMInstance providerModule; |
|
| |
if (request->getType() == CIM_EXPORT_INDICATION_REQUEST_MESSAGE) | if (request->getType() == CIM_EXPORT_INDICATION_REQUEST_MESSAGE) |
{ | { |
|
// |
// Get a ProviderIdContainer for ExportIndicationRequestMessage. | // Get a ProviderIdContainer for ExportIndicationRequestMessage. |
// Note: This can be removed when the CIMExportRequestDispatcher | // Note: This can be removed when the CIMExportRequestDispatcher |
// is updated to add the ProviderIdContainer to the message. | // is updated to add the ProviderIdContainer to the message. |
|
// |
|
CIMInstance providerModule; |
CIMInstance provider; | CIMInstance provider; |
const CIMExportIndicationRequestMessage* expRequest = | const CIMExportIndicationRequestMessage* expRequest = |
dynamic_cast<const CIMExportIndicationRequestMessage*>(request); | dynamic_cast<const CIMExportIndicationRequestMessage*>(request); |
_providerRegistrationManager->lookupIndicationConsumer( |
if (_providerRegistrationManager->lookupIndicationConsumer( |
expRequest->destinationPath, provider, providerModule); |
expRequest->destinationPath, provider, providerModule)) |
|
{ |
request->operationContext.insert( | request->operationContext.insert( |
ProviderIdContainer(providerModule, provider)); | ProviderIdContainer(providerModule, provider)); |
} | } |
else | else |
{ | { |
|
consumerLookupFailed = true; |
|
} |
|
} |
|
|
|
if (consumerLookupFailed) |
|
{ |
|
CIMResponseMessage* cimResponse = request->buildResponse(); |
|
cimResponse->cimException = PEGASUS_CIM_EXCEPTION( |
|
CIM_ERR_NOT_SUPPORTED, String::EMPTY); |
|
response = cimResponse; |
|
} |
|
else if ((dynamic_cast<CIMOperationRequestMessage*>(request) != 0) || |
|
(dynamic_cast<CIMIndicationRequestMessage*>(request) != 0) || |
|
(request->getType() == CIM_EXPORT_INDICATION_REQUEST_MESSAGE) || |
|
(request->getType() == CIM_INITIALIZE_PROVIDER_REQUEST_MESSAGE)) |
|
{ |
|
// Handle CIMOperationRequestMessage, CIMExportIndicationRequestMessage, |
|
// CIMIndicationRequestMessage, and CIMInitializeProviderRequestMessage. |
|
// (These should be blocked when the provider module is disabled.) |
|
|
|
// |
|
// Get the provider module instance to check for a disabled module |
|
// |
|
CIMInstance providerModule; |
|
|
// The provider ID container is added to the OperationContext | // The provider ID container is added to the OperationContext |
// by the CIMOperationRequestDispatcher for all CIM operation | // by the CIMOperationRequestDispatcher for all CIM operation |
// requests to providers, so it does not need to be added again. | // requests to providers, so it does not need to be added again. |
|
|
ProviderIdContainer pidc = | ProviderIdContainer pidc = |
request->operationContext.get(ProviderIdContainer::NAME); | request->operationContext.get(ProviderIdContainer::NAME); |
providerModule = pidc.getModule(); | providerModule = pidc.getModule(); |
} |
|
| |
// | // |
// Check if the target provider is disabled | // Check if the target provider is disabled |
|
|
try | try |
{ | { |
AcceptLanguageListContainer cntr = request->operationContext.get(AcceptLanguageListContainer::NAME); | AcceptLanguageListContainer cntr = request->operationContext.get(AcceptLanguageListContainer::NAME); |
}catch(Exception &e) |
}catch(const Exception &) |
{ | { |
request->operationContext.insert(AcceptLanguageListContainer(AcceptLanguages::EMPTY)); | request->operationContext.insert(AcceptLanguageListContainer(AcceptLanguages::EMPTY)); |
} | } |