本文整理汇总了C++中MessageLoaderParms函数的典型用法代码示例。如果您正苦于以下问题:C++ MessageLoaderParms函数的具体用法?C++ MessageLoaderParms怎么用?C++ MessageLoaderParms使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了MessageLoaderParms函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: checkBlocked
static void checkBlocked(CIMInstance &pm)
{
PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "checkBlocked");
Array<Uint16> operationalStatus;
Uint32 pos = pm.findProperty(CIMName ("OperationalStatus"));
if(pos == PEG_NOT_FOUND) {
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
"OperationalStatus not found.");
PEG_METHOD_EXIT();
//l10n
//throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, "provider lookup failed.");
throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, MessageLoaderParms(
"ProviderManager.ProviderManagerService.PROVIDER_LOOKUP_FAILED",
"provider lookup failed."));
}
pm.getProperty(pos).getValue().get(operationalStatus);
for(Uint32 i = 0; i < operationalStatus.size(); i++) {
if(operationalStatus[i] == _MODULE_STOPPED ||
operationalStatus[i] == _MODULE_STOPPING) {
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4,
"Provider blocked.");
PEG_METHOD_EXIT();
//l10n
//throw PEGASUS_CIM_EXCEPTION(CIM_ERR_ACCESS_DENIED, "provider blocked.");
throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_ACCESS_DENIED, MessageLoaderParms(
"ProviderManager.ProviderManagerService.PROVIDER_BLOCKED",
"provider blocked."));
}
}
}
示例2: MessageLoaderParms
void AuditLogger::setEnabled(Boolean enable)
{
if (enable)
{
if (!_auditLogFlag)
{
Logger::put_l(Logger::STANDARD_LOG, System::CIMSERVER,
Logger::INFORMATION,
MessageLoaderParms(
"Common.AuditLogger.ENABLE_AUDIT_LOG",
"Audit logging is enabled."));
// only call the audit intiialzation call back if set.
if (_auditLogInitializeCallback != 0)
{
_auditLogInitializeCallback();
}
}
}
else
{
if (_auditLogFlag)
{
Logger::put_l(Logger::STANDARD_LOG, System::CIMSERVER,
Logger::INFORMATION,
MessageLoaderParms(
"Common.AuditLogger.DISABLE_AUDIT_LOG",
"Audit logging is disabled."));
}
}
_auditLogFlag = enable;
}
示例3: PEG_METHOD_ENTER
void ZOSConsoleManager::_issueSyntaxError(const char* command)
{
PEG_METHOD_ENTER(TRC_SERVER,
"ZOSConsoleManager::_issueSyntaxError");
Logger::put_l(
Logger::ERROR_LOG, System::CIMSERVER, Logger::SEVERE,
MessageLoaderParms(
"Server.ConsoleManager_zOS.CON_SYNTAX_ERR.PEGASUS_OS_ZOS",
"CIM MODIFY COMMAND REJECTED DUE TO SYNTAX ERROR"));
if (!strncmp(command,STRLIT_ARGS(ZOSCONSOLEMANAGER_TOKEN_CONFIG)))
{
Logger::put_l(
Logger::STANDARD_LOG, System::CIMSERVER, Logger::INFORMATION,
MessageLoaderParms(
"Server.ConsoleManager_zOS.CON_MODIFY_SYNTAX.PEGASUS_OS_ZOS",
"Syntax is: "
"MODIFY CFZCIM,APPL=CONFIG,<name>=<value>[,PLANNED]"));
}
else if (!strncmp(command,STRLIT_ARGS(ZOSCONSOLEMANAGER_TOKEN_ENV)))
{
Logger::put_l(
Logger::STANDARD_LOG, System::CIMSERVER, Logger::INFORMATION,
MessageLoaderParms(
"Server.ConsoleManager_zOS."
"CON_MODIFY_ENV_SYNTAX.PEGASUS_OS_ZOS",
"Syntax is:"
" MODIFY CFZCIM,APPL=ENV[,<varname>][=<value>]"));
}
PEG_METHOD_EXIT();
}
示例4: PEG_METHOD_ENTER
void ProviderAgent::_writeResponse(Message* message)
{
PEG_METHOD_ENTER(TRC_PROVIDERAGENT, "ProviderAgent::_writeResponse");
CIMMessage* response = dynamic_cast<CIMMessage*>(message);
PEGASUS_ASSERT(response != 0);
//
// Write the response message to the pipe
//
try
{
// Use Mutex to prevent concurrent writes to the same pipe
AutoMutex pipeLock(_pipeToServerMutex);
AnonymousPipe::Status writeStatus =
_pipeToServer->writeMessage(response);
if (writeStatus != AnonymousPipe::STATUS_SUCCESS)
{
PEG_TRACE_CSTRING(TRC_PROVIDERAGENT, Tracer::LEVEL1,
"Error writing response to pipe.");
Logger::put_l(Logger::ERROR_LOG, System::CIMSERVER, Logger::WARNING,
MessageLoaderParms(
"ProviderManager.ProviderAgent.ProviderAgent."
"CIMSERVER_COMMUNICATION_FAILED",
"cimprovagt \"$0\" communication with CIM Server failed. "
"Exiting.",
_agentId));
_terminating = true;
}
}
catch (...)
{
PEG_TRACE_CSTRING(TRC_PROVIDERAGENT, Tracer::LEVEL1,
"Caught exception while writing response.");
Logger::put_l(Logger::ERROR_LOG, System::CIMSERVER, Logger::WARNING,
MessageLoaderParms(
"ProviderManager.ProviderAgent.ProviderAgent."
"CIMSERVER_COMMUNICATION_FAILED",
"cimprovagt \"$0\" communication with CIM Server failed. "
"Exiting.",
_agentId));
_terminating = true;
}
PEG_METHOD_EXIT();
}
示例5: _getKeyValue
void _getKeyValue (
const CIMObjectPath& instanceName,
CIMNamespaceName& childNamespaceName,
Boolean& isRelativeName)
{
Array<CIMKeyBinding> kbArray = instanceName.getKeyBindings();
if ((kbArray.size() == 1) &&
(kbArray[0].getName() == NAMESPACE_PROPERTYNAME))
{
String childNamespaceString = kbArray[0].getValue();
if (childNamespaceString != String::EMPTY)
{
childNamespaceName = childNamespaceString;
}
isRelativeName = !(childNamespaceName.isNull());
}
else
{
//l10n
//throw CIMInvalidParameterException("Invalid key property: ");
throw CIMInvalidParameterException(MessageLoaderParms(
"ControlProviders.NamespaceProvider.NamespaceProvider.INVALID_KEY_PROPERTY",
"Invalid key property: "));
}
}
示例6: PEGASUS_DEBUG_ASSERT
void Mutex::lock()
{
PEGASUS_DEBUG_ASSERT(_magic);
int r = pthread_mutex_lock(&_rep.mutex);
if (r == 0)
{
#if defined(PEGASUS_DEBUG)
_rep.count++;
#endif
}
else
{
if (r != -1)
{
// Special behavior for Single UNIX Specification, Version 3
errno = r;
}
throw Exception(MessageLoaderParms(
MUTEX_LOCK_FAILED_KEY,
MUTEX_LOCK_FAILED_MSG,
PEGASUS_SYSTEM_ERRORMSG_NLS));
}
}
示例7: _resolvePhysicalName
ProviderName DefaultProviderManager::_resolveProviderName(
const ProviderIdContainer& providerId)
{
String providerName;
String fileName;
String moduleName;
CIMValue genericValue;
genericValue = providerId.getModule().getProperty(
providerId.getModule().findProperty(
PEGASUS_PROPERTYNAME_NAME)).getValue();
genericValue.get(moduleName);
genericValue = providerId.getProvider().getProperty(
providerId.getProvider().findProperty(
PEGASUS_PROPERTYNAME_NAME)).getValue();
genericValue.get(providerName);
genericValue = providerId.getModule().getProperty(
providerId.getModule().findProperty("Location")).getValue();
genericValue.get(fileName);
String resolvedFileName = _resolvePhysicalName(fileName);
if (resolvedFileName == String::EMPTY)
{
// Provider library not found
throw Exception(MessageLoaderParms(
"ProviderManager.ProviderManagerService.PROVIDER_FILE_NOT_FOUND",
"File \"$0\" was not found for provider module \"$1\".",
FileSystem::buildLibraryFileName(fileName), moduleName));
}
return ProviderName(moduleName, providerName, resolvedFileName);
}
示例8: _generateFullNamespaceName
void _generateFullNamespaceName(
Array<CIMNamespaceName>& namespaceNames,
CIMNamespaceName& parentNamespaceName,
CIMNamespaceName& childNamespaceName,
Boolean isRelativeName,
CIMNamespaceName& fullNamespaceName)
{
// If isRelativeName is true, then the parentNamespace
// MUST exist
//
if (isRelativeName)
{
if (!Contains(namespaceNames, parentNamespaceName))
{
//l10n
//throw CIMObjectNotFoundException("Parent namespace does not exist: "
//+ parentNamespaceName.getString());
throw CIMObjectNotFoundException(MessageLoaderParms(
"ControlProviders.NamespaceProvider.NamespaceProvider.PARENT_NAMESPACE_DOES_NOT_EXIST",
"Parent namespace does not exist: $0",
parentNamespaceName.getString()));
}
// Create full namespace name by prepending parentNamespaceName
fullNamespaceName = CIMNamespaceName (parentNamespaceName.getString()
+ "/" + childNamespaceName.getString());
}
else
{
fullNamespaceName = parentNamespaceName;
}
}
示例9: PEG_METHOD_ENTER
//
// Removes the file that was created
//
Boolean LocalAuthFile::remove()
{
PEG_METHOD_ENTER(TRC_AUTHENTICATION, "LocalAuthFile::remove()");
Boolean retVal = true;
//
// remove the file
//
if (FileSystem::exists(_filePathName))
{
#if !defined(PEGASUS_OS_TYPE_WINDOWS)
// change ownership back to the CIMOM
int rc = chown(
(const char *)_filePathName.getCString(), geteuid(), getegid());
if (rc == -1)
{
Logger::put_l(Logger::ERROR_LOG, System::CIMSERVER, Logger::WARNING,
MessageLoaderParms(
"Security.Authentication.LocalAuthFile.NO_CHOWN",
"Changing ownership of the local authentication "
"security file back to the CIMServer UserId failed."));
}
#endif
retVal = FileSystem::removeFile(_filePathName);
}
PEG_METHOD_EXIT();
return retVal;
}
示例10: PEG_METHOD_ENTER
void FileListenerDestination::_recordIndicationToFile(
const char* path,
const String& formattedText)
{
PEG_METHOD_ENTER(TRC_IND_HANDLER,
"FileListenerDestination::_recordIndicationToFile");
FILE *fd = fopen(path, "a");
if(fd)
{
if( fprintf(fd, "%s\n", (const char*)formattedText.getCString()) > 0)
{
fclose(fd);
}
else
{
fclose(fd);
PEG_METHOD_EXIT();
throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, MessageLoaderParms(
"Handler.FileListenerDestination.FileListenerDestination."
"FAILED_TO_WRITE_INDICATION_TO_FILE",
"Failed to write indication to local file $0.",
path));
}
}
else // file opening failed
{
PEG_METHOD_EXIT();
ThrowCannotOpenFileException(path);
}
PEG_METHOD_EXIT();
}
示例11: PEG_METHOD_ENTER
/** This method should be called after the consumer is terminated and the
* module is unloaded. Note that we cannot test for a loaded condition,
* since the _module reference here may still exist (if more than one
* consumer is using the module).
* Simply test whether the consumer is initialized.
* If it was terminated properly, initialized will be false and the _module
* ref count will be decremented.
*/
void DynamicConsumer::reset()
{
PEG_METHOD_ENTER(TRC_LISTENER, "DynamicConsumer::reset");
if (_initialized)
{
throw Exception(
MessageLoaderParms(
"DynListener.DynamicConsumer.CONSUMER_INVALID_STATE",
"Error: The consumer is not in the correct state to "
"perform the operation."));
}
// do not delete it, that is taken care of in ConsumerModule itself
_module = 0;
// ATTN: attempting to delete this causes an exception -- why??
_consumer = 0;
PEG_TRACE((TRC_LISTENER,Tracer::LEVEL4,
"Deleting %d outstanding requests for %s",
_eventqueue.size(),
(const char*)_name.getCString()));
//delete outstanding requests
IndicationDispatchEvent* event = 0;
for (Uint32 i = 0; i < _eventqueue.size(); i++)
{
event = _eventqueue.remove_front();
delete event;
}
PEG_METHOD_EXIT();
}
示例12: ClientCIMOMHandleAccessController
ClientCIMOMHandleAccessController(Mutex& lock)
: _lock(lock)
{
try
{
// assume default client timeout
if (!_lock.timed_lock(PEGASUS_DEFAULT_CLIENT_TIMEOUT_MILLISECONDS))
{
throw CIMException(CIM_ERR_ACCESS_DENIED, MessageLoaderParms(
"Provider.CIMOMHandle.CIMOMHANDLE_TIMEOUT",
"Timeout waiting for CIMOMHandle"));
}
}
catch (Exception& e)
{
PEG_TRACE((TRC_CIMOM_HANDLE, Tracer::LEVEL2,
"Unexpected Exception: %s",
(const char*)e.getMessage().getCString()));
throw;
}
catch (...)
{
PEG_TRACE_CSTRING(TRC_CIMOM_HANDLE, Tracer::LEVEL2,
"Unexpected exception");
throw;
}
}
示例13: MessageLoaderParms
/**
UnrecognizedConfigProperty Exception class
*/
UnrecognizedConfigProperty::UnrecognizedConfigProperty(const String& name)
:Exception(
MessageLoaderParms(
"Config.ConfigExceptions.UNRECOGNIZED_CONFIG_PROPERTY",
"Unrecognized config property: $0",
name))
{
}
示例14: isProviderDirValid
/**
Checks if the given directory is existing and writable
*/
Boolean isProviderDirValid(const String& dirName)
{
String path;
Uint32 pos=0;
Uint32 token=0;
// make multiple, relative paths absolute for check
String temp = ConfigManager::getHomedPath(dirName);
do
{
if (( pos = temp.find(FileSystem::getPathDelimiter())) == PEG_NOT_FOUND)
{
pos = temp.size();
token = 0;
}
else
{
token = 1;
}
path = temp.subString(0,pos);
if (!FileSystem::isDirectory(path))
{
Logger::put_l(
Logger::ERROR_LOG, System::CIMSERVER, Logger::SEVERE,
MessageLoaderParms(
"Config.ProviderDirPropertyOwner.NOT_A_DIRECTORY",
"providerDir configuration value $0 is not a directory.",
path));
return false;
}
if (!FileSystem::canRead(path))
{
Logger::put_l(
Logger::ERROR_LOG, System::CIMSERVER, Logger::SEVERE,
MessageLoaderParms(
"Config.ProviderDirPropertyOwner.DIRECTORY_NOT_READABLE",
"providerDir configuration directory $0 is not readable.",
path));
return false;
}
temp.remove(0,pos+token);
}
while ( temp.size() > 0 );
return true;
}
示例15: _formPartialMessage
static MessageLoaderParms _formPartialMessage(Uint32 code, Uint32 line)
{
String dftMsg = _xmlMessages[Uint32(code) - 1];
const char* key = _xmlKeys[Uint32(code) - 1];
dftMsg.append(": on line $0");
return MessageLoaderParms(key, dftMsg.getCString(), line);
}