version 1.71, 2006/08/29 17:48:56
|
version 1.76, 2006/10/10 18:27:09
|
|
|
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
} | } |
| |
Message* DefaultProviderManager::processMessage(Message* request) |
Message* DefaultProviderManager::processMessage(Message* message) |
{ | { |
PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, | PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, |
"DefaultProviderManager::processMessage()"); | "DefaultProviderManager::processMessage()"); |
| |
Message* response = 0; |
CIMRequestMessage* request = dynamic_cast<CIMRequestMessage*>(message); |
|
PEGASUS_ASSERT(request != 0); |
|
|
|
CIMResponseMessage* response = 0; |
| |
|
try |
|
{ |
// pass the request message to a handler method based on message type | // pass the request message to a handler method based on message type |
switch(request->getType()) | switch(request->getType()) |
{ | { |
|
|
case CIM_DELETE_SUBSCRIPTION_REQUEST_MESSAGE: | case CIM_DELETE_SUBSCRIPTION_REQUEST_MESSAGE: |
case CIM_EXPORT_INDICATION_REQUEST_MESSAGE: | case CIM_EXPORT_INDICATION_REQUEST_MESSAGE: |
{ | { |
CIMRequestMessage* cimRequest = |
|
dynamic_cast<CIMRequestMessage*>(request); |
|
|
|
// resolve provider name | // resolve provider name |
ProviderName name = _resolveProviderName( | ProviderName name = _resolveProviderName( |
cimRequest->operationContext.get(ProviderIdContainer::NAME)); |
request->operationContext.get(ProviderIdContainer::NAME)); |
| |
// get cached or load new provider module | // get cached or load new provider module |
ProviderOperationCounter poc( | ProviderOperationCounter poc( |
_getProvider(name.getPhysicalName(), name.getLogicalName())); | _getProvider(name.getPhysicalName(), name.getLogicalName())); |
| |
response = poc.GetProvider().processMessage(cimRequest); |
response = poc.GetProvider().processMessage(request); |
break; | break; |
} | } |
| |
|
|
break; | break; |
| |
case CIM_STOP_ALL_PROVIDERS_REQUEST_MESSAGE: | case CIM_STOP_ALL_PROVIDERS_REQUEST_MESSAGE: |
response = _handleStopAllProvidersRequest(request); |
// tell the provider manager to shutdown all the providers |
break; |
_shutdownAllProviders(); |
|
response = request->buildResponse(); |
case CIM_INITIALIZE_PROVIDER_REQUEST_MESSAGE: |
|
response = _handleInitializeProviderRequest(request); |
|
break; | break; |
| |
case CIM_SUBSCRIPTION_INIT_COMPLETE_REQUEST_MESSAGE: | case CIM_SUBSCRIPTION_INIT_COMPLETE_REQUEST_MESSAGE: |
response = _handleSubscriptionInitCompleteRequest(request); | response = _handleSubscriptionInitCompleteRequest(request); |
break; | break; |
| |
default: |
// Note: The PG_Provider AutoStart property is not yet supported |
PEGASUS_ASSERT(0); |
#if 0 |
break; |
case CIM_INITIALIZE_PROVIDER_REQUEST_MESSAGE: |
} |
|
|
|
PEG_METHOD_EXIT(); |
|
|
|
return response; |
|
} |
|
|
|
Message* DefaultProviderManager::_handleInitializeProviderRequest( |
|
Message* message) |
|
{ |
|
PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, |
|
"DefaultProviderManager::_handleInitializeProviderRequest"); |
|
|
|
CIMInitializeProviderRequestMessage* request = |
|
dynamic_cast<CIMInitializeProviderRequestMessage*>(message); |
|
PEGASUS_ASSERT(request != 0); |
|
|
|
CIMInitializeProviderResponseMessage* response = |
|
dynamic_cast<CIMInitializeProviderResponseMessage*>( |
|
request->buildResponse()); |
|
PEGASUS_ASSERT(response != 0); |
|
|
|
try |
|
{ | { |
// resolve provider name | // resolve provider name |
ProviderName name = _resolveProviderName( | ProviderName name = _resolveProviderName( |
|
|
// get cached or load new provider module | // get cached or load new provider module |
ProviderOperationCounter poc( | ProviderOperationCounter poc( |
_getProvider(name.getPhysicalName(), name.getLogicalName())); | _getProvider(name.getPhysicalName(), name.getLogicalName())); |
|
|
|
break; |
|
} |
|
#endif |
|
|
|
default: |
|
PEGASUS_ASSERT(0); |
|
break; |
|
} |
} | } |
catch (CIMException& e) | catch (CIMException& e) |
{ | { |
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL3, |
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL2, |
"CIMException: " + e.getMessage()); | "CIMException: " + e.getMessage()); |
|
response = request->buildResponse(); |
response->cimException = PEGASUS_CIM_EXCEPTION_LANG( | response->cimException = PEGASUS_CIM_EXCEPTION_LANG( |
e.getContentLanguages(), e.getCode(), e.getMessage()); | e.getContentLanguages(), e.getCode(), e.getMessage()); |
} | } |
catch (Exception& e) | catch (Exception& e) |
{ | { |
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL3, |
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL2, |
"Exception: " + e.getMessage()); | "Exception: " + e.getMessage()); |
|
response = request->buildResponse(); |
response->cimException = PEGASUS_CIM_EXCEPTION_LANG( | response->cimException = PEGASUS_CIM_EXCEPTION_LANG( |
e.getContentLanguages(), CIM_ERR_FAILED, e.getMessage()); | e.getContentLanguages(), CIM_ERR_FAILED, e.getMessage()); |
} | } |
catch (...) | catch (...) |
{ | { |
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL3, |
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL2, |
"Exception: Unknown"); | "Exception: Unknown"); |
|
response = request->buildResponse(); |
response->cimException = PEGASUS_CIM_EXCEPTION( | response->cimException = PEGASUS_CIM_EXCEPTION( |
CIM_ERR_FAILED, "Unknown error."); | CIM_ERR_FAILED, "Unknown error."); |
} | } |
|
|
return response; | return response; |
} | } |
| |
Message* DefaultProviderManager::_handleDisableModuleRequest(Message* message) |
CIMResponseMessage* DefaultProviderManager::_handleDisableModuleRequest( |
|
CIMRequestMessage* message) |
{ | { |
PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, | PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, |
"DefaultProviderManager::_handleDisableModuleRequest"); | "DefaultProviderManager::_handleDisableModuleRequest"); |
|
|
return response; | return response; |
} | } |
| |
Message* DefaultProviderManager::_handleEnableModuleRequest(Message* message) |
CIMResponseMessage* DefaultProviderManager::_handleEnableModuleRequest( |
|
CIMRequestMessage* message) |
{ | { |
PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, | PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, |
"DefaultProviderManager::_handleEnableModuleRequest"); | "DefaultProviderManager::_handleEnableModuleRequest"); |
|
|
return response; | return response; |
} | } |
| |
Message* DefaultProviderManager::_handleStopAllProvidersRequest( |
CIMResponseMessage* |
Message* message) |
DefaultProviderManager::_handleSubscriptionInitCompleteRequest( |
{ |
CIMRequestMessage* message) |
PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, |
|
"DefaultProviderManager::_handleStopAllProvidersRequest"); |
|
|
|
CIMStopAllProvidersRequestMessage* request = |
|
dynamic_cast<CIMStopAllProvidersRequestMessage*>(message); |
|
PEGASUS_ASSERT(request != 0); |
|
|
|
CIMStopAllProvidersResponseMessage* response = |
|
dynamic_cast<CIMStopAllProvidersResponseMessage*>( |
|
request->buildResponse()); |
|
PEGASUS_ASSERT(response != 0); |
|
|
|
// tell the provider manager to shutdown all the providers |
|
_shutdownAllProviders(); |
|
|
|
PEG_METHOD_EXIT(); |
|
return response; |
|
} |
|
|
|
Message* DefaultProviderManager::_handleSubscriptionInitCompleteRequest( |
|
Message* message) |
|
{ | { |
PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, | PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, |
"DefaultProviderManager::_handleSubscriptionInitCompleteRequest"); | "DefaultProviderManager::_handleSubscriptionInitCompleteRequest"); |
|
|
// | // |
for (Uint32 j = 0; j < providerList.size(); j++) | for (Uint32 j = 0; j < providerList.size(); j++) |
{ | { |
|
AutoMutex lock(providerList[j]->status.getStatusMutex()); |
|
|
|
if (providerList[j]->status.isInitialized()) |
|
{ |
providerList[j]->subscriptionInitComplete(); | providerList[j]->subscriptionInitComplete(); |
} | } |
|
} |
| |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
return response; | return response; |
|
|
if (!pr->status.isInitialized()) | if (!pr->status.isInitialized()) |
{ | { |
_initProvider(pr, moduleFileName); | _initProvider(pr, moduleFileName); |
|
} |
|
|
|
AutoMutex lock(pr->status.getStatusMutex()); |
| |
if (!pr->status.isInitialized()) | if (!pr->status.isInitialized()) |
{ | { |
|
|
throw PEGASUS_CIM_EXCEPTION( | throw PEGASUS_CIM_EXCEPTION( |
CIM_ERR_FAILED, "provider initialization failed"); | CIM_ERR_FAILED, "provider initialization failed"); |
} | } |
} |
|
| |
ProviderOperationCounter poc(pr); | ProviderOperationCounter poc(pr); |
poc.GetProvider().status.update_idle_timer(); |
|
| |
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, | PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, |
"Returning Provider " + providerName); | "Returning Provider " + providerName); |
|
|
ProviderModule* module = 0; | ProviderModule* module = 0; |
CIMProvider* base; | CIMProvider* base; |
| |
{ |
|
// lock the providerTable mutex |
|
AutoMutex lock(_providerTableMutex); |
|
|
|
// lookup provider module | // lookup provider module |
module = _lookupModule(moduleFileName); | module = _lookupModule(moduleFileName); |
} // unlock the providerTable mutex |
|
| |
{ |
|
// lock the provider status mutex | // lock the provider status mutex |
AutoMutex lock(provider->status._statusMutex); |
AutoMutex lock(provider->status.getStatusMutex()); |
| |
if (provider->status.isInitialized()) | if (provider->status.isInitialized()) |
{ | { |
|
|
CIMOMHandle *cimomHandle = new CIMOMHandle(); | CIMOMHandle *cimomHandle = new CIMOMHandle(); |
provider->status.setCIMOMHandle(cimomHandle); | provider->status.setCIMOMHandle(cimomHandle); |
provider->status.setModule(module); | provider->status.setModule(module); |
provider->status._quantum=0; |
|
provider->setProvider(base); | provider->setProvider(base); |
| |
Boolean initializeError = false; | Boolean initializeError = false; |
| |
try | try |
{ | { |
provider->initialize(*(provider->status._cimom_handle)); |
provider->initialize(*cimomHandle); |
} | } |
catch (...) | catch (...) |
{ | { |
initializeError = true; | initializeError = true; |
} | } |
| |
provider->status.setInitialized(!initializeError); |
|
provider->status._currentOperations = 0; |
|
|
|
// The cleanup code executed when an exception occurs was previously | // The cleanup code executed when an exception occurs was previously |
// included in the catch block above. Unloading the provider module | // included in the catch block above. Unloading the provider module |
// from inside the catch block resulted in a crash when an exception | // from inside the catch block resulted in a crash when an exception |
|
|
// pointers related to the code that threw the exception. In the case | // pointers related to the code that threw the exception. In the case |
// of an exception thrown from a provider during the initialize() | // of an exception thrown from a provider during the initialize() |
// method, those pointers point into the provider library, so when | // method, those pointers point into the provider library, so when |
// the LocalProviderManager unloads the library, the pointers into the |
// the DefaultProviderManager unloads the library, the pointers into |
// library that the program was holding are invalid. |
// the library that the program was holding are invalid. |
|
|
if (initializeError == true) | if (initializeError == true) |
{ | { |
// delete the cimom handle |
// Allow the provider to clean up |
delete provider->status._cimom_handle; |
provider->terminate(); |
| |
// set provider status to uninitialized |
// delete the cimom handle |
provider->status.reset(); |
delete cimomHandle; |
| |
provider->setProvider(0); | provider->setProvider(0); |
| |
// unload provider module | // unload provider module |
module->unloadModule(); | module->unloadModule(); |
} | } |
} // unlock the provider status mutex |
|
|
provider->status.setInitialized(!initializeError); |
| |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
return provider; | return provider; |
|
|
PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, | PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, |
"DefaultProviderManager::_lookupModule"); | "DefaultProviderManager::_lookupModule"); |
| |
|
// lock the providerTable mutex |
|
AutoMutex lock(_providerTableMutex); |
|
|
// look up provider module in cache | // look up provider module in cache |
ProviderModule* module = 0; | ProviderModule* module = 0; |
| |
|
|
void DefaultProviderManager::unloadIdleProviders() | void DefaultProviderManager::unloadIdleProviders() |
{ | { |
PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, | PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, |
"LocalProviderManager::unloadIdleProviders"); |
"DefaultProviderManager::unloadIdleProviders"); |
|
|
static Uint32 quantum = 0; |
|
static struct timeval first = {0,0}, now, last = {0,0}; |
|
|
|
if (first.tv_sec == 0) |
|
{ |
|
Time::gettimeofday(&first); |
|
} |
|
Time::gettimeofday(&now); |
|
|
|
if (!(((now.tv_sec - first.tv_sec) > IDLE_LIMIT) && |
|
((now.tv_sec - last.tv_sec) > IDLE_LIMIT))) |
|
{ |
|
// It's not time yet to check for idle providers |
|
PEG_METHOD_EXIT(); |
|
return; |
|
} |
|
|
|
Time::gettimeofday(&last); |
|
|
|
Time::gettimeofday(&last); |
|
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, |
|
"Checking for Idle providers to unload."); |
|
| |
try | try |
{ | { |
AutoMutex lock(_providerTableMutex); |
|
|
|
quantum++; |
|
|
|
struct timeval now; | struct timeval now; |
Time::gettimeofday(&now); | Time::gettimeofday(&now); |
| |
for (ProviderTable::Iterator i = _providers.start(); i != 0 ; i++) |
// Make a copy of the table so it is not locked during provider calls |
{ |
Array<ProviderMessageHandler*> providerList; |
ProviderMessageHandler* provider = i.value(); |
|
PEGASUS_ASSERT(provider != 0); |
|
|
|
if (!provider->status.isInitialized()) |
|
{ | { |
continue; |
AutoMutex lock(_providerTableMutex); |
} |
|
| |
if (provider->status._quantum == quantum) |
for (ProviderTable::Iterator i = _providers.start(); i != 0; i++) |
{ | { |
continue; |
providerList.append(i.value()); |
} | } |
|
|
provider->status._quantum = quantum; |
|
|
|
if (provider->status._currentOperations.get()) |
|
{ |
|
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, |
|
"Provider has pending operations: " + |
|
provider->getName()); |
|
continue; |
|
} | } |
| |
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, |
for (Uint32 i = 0; i < providerList.size(); i++) |
"Checking timeout data for Provider: " + |
|
provider->getName()); |
|
struct timeval timeout = {0,0}; |
|
provider->status.get_idle_timer(&timeout); |
|
|
|
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, |
|
"provider->status.unload_ok() returns: " + |
|
provider->status.unload_ok() ? "true" : "false"); |
|
|
|
if (provider->status.unload_ok() && |
|
((now.tv_sec - timeout.tv_sec) > ((Sint32)IDLE_LIMIT))) |
|
{ | { |
AutoMutex pr_lock(provider->status._statusMutex); |
ProviderMessageHandler* provider = providerList[i]; |
Logger::put( |
|
Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE, |
|
"LocalProviderManager::unloadIdleProviders - " |
|
"Unload idle provider $0", provider->getName()); |
|
| |
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, |
AutoMutex lock(provider->status.getStatusMutex()); |
"Trying to Terminate Provider " + provider->getName()); |
|
try |
|
{ |
|
if (!provider->status.unload_ok()) |
|
{ |
|
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, |
|
"Provider not OK to unload: " + |
|
provider->getName()); |
|
continue; |
|
} |
|
|
|
provider->terminate(); |
|
| |
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, |
if (!provider->status.isInitialized()) |
"Provider terminated: " + provider->getName()); |
|
provider->status.setInitialized(false); |
|
} |
|
catch (...) |
|
{ | { |
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, |
|
"Exception terminating " + provider->getName()); |
|
i = _providers.start(); |
|
continue; | continue; |
} | } |
| |
PEGASUS_ASSERT(provider->status._module != 0); |
struct timeval providerTime = {0, 0}; |
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, |
provider->status.getLastOperationEndTime(&providerTime); |
"unloading Provider module" + provider->getName()); |
|
provider->status._module->unloadModule(); |
|
| |
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, | PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, |
"Destroying Provider's CIMOM Handle: " + |
"provider->status.isIdle() returns: " + |
provider->getName()); |
CIMValue(provider->status.isIdle()).toString()); |
delete provider->status._cimom_handle; |
|
| |
provider->status.reset(); |
if (provider->status.isIdle() && |
|
((now.tv_sec - providerTime.tv_sec) > ((Sint32)IDLE_LIMIT))) |
|
{ |
|
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL2, |
|
"Unloading idle provider: " + provider->getName()); |
|
_unloadProvider(provider); |
} | } |
} | } |
} | } |
|
|
ProviderMessageHandler* provider = i.value(); | ProviderMessageHandler* provider = i.value(); |
PEGASUS_ASSERT(provider != 0); | PEGASUS_ASSERT(provider != 0); |
| |
|
AutoMutex lock(provider->status.getStatusMutex()); |
|
|
if (provider->status.isInitialized()) | if (provider->status.isInitialized()) |
{ | { |
_unloadProvider(provider); | _unloadProvider(provider); |
|
|
// expires. | // expires. |
// | // |
Uint32 waitTime = PROVIDER_DISABLE_TIMEOUT; | Uint32 waitTime = PROVIDER_DISABLE_TIMEOUT; |
while ((pr->status._currentOperations.get() > 0) && (waitTime > 0)) |
while ((pr->status.numCurrentOperations() > 0) && (waitTime > 0)) |
{ | { |
Threads::sleep(1000); | Threads::sleep(1000); |
waitTime = waitTime - 1; | waitTime = waitTime - 1; |
} | } |
| |
// There are still pending requests, do not disable | // There are still pending requests, do not disable |
if (pr->status._currentOperations.get() > 0) |
if (pr->status.numCurrentOperations() > 0) |
{ | { |
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, | PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, |
"Disable failed since there are pending requests."); | "Disable failed since there are pending requests."); |
|
|
| |
try | try |
{ | { |
AutoMutex lock(_providerTableMutex); |
AutoMutex lock(pr->status.getStatusMutex()); |
| |
if (pr->status.isInitialized()) | if (pr->status.isInitialized()) |
{ | { |
|
|
void DefaultProviderManager::_unloadProvider(ProviderMessageHandler* provider) | void DefaultProviderManager::_unloadProvider(ProviderMessageHandler* provider) |
{ | { |
// | // |
// NOTE: It is the caller's responsibility to make sure that |
// NOTE: It is the caller's responsibility to make sure that the |
// the ProviderTable mutex is locked before calling this method. |
// provider->status.getStatusMutex() mutex is locked before calling |
|
// this method. |
// | // |
|
|
PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, | PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, |
"DefaultProviderManager::_unloadProvider"); | "DefaultProviderManager::_unloadProvider"); |
| |
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, |
if (provider->status.numCurrentOperations() > 0) |
"Unloading Provider " + provider->getName()); |
|
|
|
if (provider->status._currentOperations.get() > 0) |
|
{ | { |
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, | PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, |
"Provider cannot be unloaded due to pending operations: " + | "Provider cannot be unloaded due to pending operations: " + |
|
|
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, | PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, |
"Terminating Provider " + provider->getName()); | "Terminating Provider " + provider->getName()); |
| |
// lock the provider mutex |
|
AutoMutex pr_lock(provider->status._statusMutex); |
|
|
|
try |
|
{ |
|
provider->terminate(); | provider->terminate(); |
} |
|
catch (...) |
|
{ |
|
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL3, |
|
"Error occured terminating provider " + provider->getName()); |
|
} |
|
provider->status.setInitialized(false); |
|
|
|
PEGASUS_ASSERT(provider->status._module != 0); |
|
| |
// unload provider module | // unload provider module |
provider->status._module->unloadModule(); |
PEGASUS_ASSERT(provider->status.getModule() != 0); |
|
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL2, |
|
"Unloading provider module: " + provider->getName()); |
|
provider->status.getModule()->unloadModule(); |
| |
// NOTE: The "delete provider->status._cimom_handle" operation was |
Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE, |
// moved to be called after the unloadModule() call above |
"DefaultProviderManager: Unloaded provider $0", |
|
provider->getName()); |
|
|
|
// NOTE: The "delete provider->status.getCIMOMHandle()" operation |
|
// was moved to be called after the unloadModule() call above |
// as part of a fix for bugzilla 3669. For some providers | // as part of a fix for bugzilla 3669. For some providers |
// run out-of-process on Windows platforms (i.e. running | // run out-of-process on Windows platforms (i.e. running |
// the cimserver with the forceProviderProcesses config option | // the cimserver with the forceProviderProcesses config option |
|
|
// to deadlock, making that provider unavailable and preventing | // to deadlock, making that provider unavailable and preventing |
// the cimserver from shutting down. It should NOT be moved back | // the cimserver from shutting down. It should NOT be moved back |
// above the unloadModule() call. See bugzilla 3669 for details. | // above the unloadModule() call. See bugzilla 3669 for details. |
|
|
// delete the cimom handle | // delete the cimom handle |
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, | PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, |
"Destroying Provider's CIMOM Handle " + provider->getName()); |
"Destroying provider's CIMOMHandle: " + provider->getName()); |
delete provider->status._cimom_handle; |
delete provider->status.getCIMOMHandle(); |
|
|
Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE, |
|
"ProviderManager::_provider_crtl - Unload provider $0", |
|
provider->getName()); |
|
| |
// set provider status to uninitialized | // set provider status to uninitialized |
provider->status.reset(); |
provider->status.setInitialized(false); |
} | } |
| |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
|
|
} | } |
| |
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |
|
|
|
PEGASUS_USING_PEGASUS; |
|
|
|
// This entry point is not needed because the DefaultProviderManager is created |
|
// using DefaultProviderManager::createDefaultProviderManagerCallback(). |
|
#if 0 |
|
extern "C" PEGASUS_EXPORT ProviderManager* PegasusCreateProviderManager( |
|
const String& providerManagerName) |
|
{ |
|
if (String::equalNoCase(providerManagerName, "Default")) |
|
{ |
|
return new DefaultProviderManager(); |
|
} |
|
|
|
return 0; |
|
} |
|
#endif |