version 1.49, 2003/08/19 18:06:57
|
version 1.51, 2003/09/10 18:36:49
|
|
|
//l10n | //l10n |
//throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, | //throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, |
//"Only can modify Namespaces, SupportedProperties, and SupportedMethods."); | //"Only can modify Namespaces, SupportedProperties, and SupportedMethods."); |
String s1 = "Namespaces"; |
|
String s2 = "SupportedProperties"; |
|
String s3 = "SupportedMethods"; |
|
throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_NOT_SUPPORTED, MessageLoaderParms( | throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_NOT_SUPPORTED, MessageLoaderParms( |
"ControlProviders.ProviderRegistrationProvider.ProviderRegistrationProvider.CAN_ONLY_MODIFY_ERR", | "ControlProviders.ProviderRegistrationProvider.ProviderRegistrationProvider.CAN_ONLY_MODIFY_ERR", |
"Only can modify $0, $1, and $2.", |
"Only can modify Namespaces, SupportedProperties, and SupportedMethods.")); |
s1, s2, s3)); |
|
} | } |
| |
Array<CIMName> propertyArray = propertyList.getPropertyNameArray(); | Array<CIMName> propertyArray = propertyList.getPropertyNameArray(); |
|
|
// | // |
try | try |
{ | { |
|
Sint16 ret_value = _disableModule(instanceReference, moduleName, true, al); |
|
|
// | // |
// if the provider disable failed | // if the provider disable failed |
// | // |
// l10n | // l10n |
if (_disableModule(instanceReference, moduleName, true, al) == -1) |
if (ret_value == -1) |
{ | { |
//l10n | //l10n |
//throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, | //throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, |
|
|
"ControlProviders.ProviderRegistrationProvider.ProviderRegistrationProvider.DISABLE_PROVIDER_FAILED", | "ControlProviders.ProviderRegistrationProvider.ProviderRegistrationProvider.DISABLE_PROVIDER_FAILED", |
"disable the provider failed.")); | "disable the provider failed.")); |
} | } |
|
// |
|
// The provider disable failed since there are pending requests |
|
// |
|
if (ret_value == -2) |
|
{ |
|
//L10N TODO |
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, |
|
"disable the provider failed: Provider is busy."); |
|
} |
} | } |
catch(CIMException&) | catch(CIMException&) |
{ | { |
|
|
// | // |
try | try |
{ | { |
|
Sint16 ret_value = _disableModule(instanceReference, moduleName, false, al); |
|
|
// | // |
// if the provider module disable failed | // if the provider module disable failed |
// | // |
// l10n | // l10n |
if (_disableModule(instanceReference, moduleName, false, al) == -1) |
if (ret_value == -1) |
{ | { |
//l10n | //l10n |
//throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, | //throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, |
|
|
"ControlProviders.ProviderRegistrationProvider.ProviderRegistrationProvider.DISABLE_PROVIDER_MODULE_FAILED", | "ControlProviders.ProviderRegistrationProvider.ProviderRegistrationProvider.DISABLE_PROVIDER_MODULE_FAILED", |
"disable the provider module failed.")); | "disable the provider module failed.")); |
} | } |
|
|
|
// |
|
// The provider module disable failed since there are pending requests |
|
// |
|
if (ret_value == -2) |
|
{ |
|
//L10N TODO |
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, |
|
"disable the provider module failed: Provider is busy."); |
|
} |
} | } |
catch(CIMException& e) | catch(CIMException& e) |
{ | { |
|
|
} | } |
| |
// disable provider module, return 0 if module is disabled successfully, | // disable provider module, return 0 if module is disabled successfully, |
// return 1 if module is already disabled, otherwise, return -1 |
// return 1 if module is already disabled, return -2 if module can not be |
|
// disabled since there are pending requests, otherwise, return -1 |
Sint16 ProviderRegistrationProvider::_disableModule( | Sint16 ProviderRegistrationProvider::_disableModule( |
const CIMObjectPath & objectReference, | const CIMObjectPath & objectReference, |
const String & moduleName, | const String & moduleName, |
|
|
moduleName, false, al); | moduleName, false, al); |
return (0); | return (0); |
} | } |
|
|
|
// module is not disabled since there are pending |
|
// requests for the providers in the module |
|
if (_opStatus[i] == _MODULE_OK) |
|
{ |
|
return (-2); |
|
} |
} | } |
} | } |
else // disable provider | else // disable provider |