当前位置: 首页>>代码示例>>C++>>正文


C++ MessageLoaderParms函数代码示例

本文整理汇总了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."));
        }
    }
}
开发者ID:ncultra,项目名称:Pegasus-2.5,代码行数:33,代码来源:ProviderRegistrar.cpp

示例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;

}
开发者ID:brunolauze,项目名称:pegasus,代码行数:34,代码来源:AuditLoggerToSMF.cpp

示例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();
}
开发者ID:deleisha,项目名称:neopegasus,代码行数:33,代码来源:ConsoleManager_zOS.cpp

示例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();
}
开发者ID:rdobson,项目名称:openpegasus,代码行数:48,代码来源:ProviderAgent.cpp

示例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:  "));
    }
}
开发者ID:ncultra,项目名称:Pegasus-2.5,代码行数:29,代码来源:NamespaceProvider.cpp

示例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));
    }
}
开发者ID:xenserver,项目名称:openpegasus,代码行数:26,代码来源:Mutex.cpp

示例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);
}
开发者ID:brunolauze,项目名称:pegasus,代码行数:35,代码来源:DefaultProviderManager.cpp

示例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;
    }

}
开发者ID:ncultra,项目名称:Pegasus-2.5,代码行数:33,代码来源:NamespaceProvider.cpp

示例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;
}
开发者ID:brunolauze,项目名称:pegasus,代码行数:37,代码来源:LocalAuthFile.cpp

示例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();
}
开发者ID:brunolauze,项目名称:pegasus,代码行数:33,代码来源:FileListenerDestination.cpp

示例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();
}
开发者ID:brunolauze,项目名称:pegasus,代码行数:41,代码来源:DynamicConsumer.cpp

示例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;
     }
 }
开发者ID:rdobson,项目名称:openpegasus,代码行数:27,代码来源:ClientCIMOMHandleRep.cpp

示例13: MessageLoaderParms

/**
    UnrecognizedConfigProperty Exception class
*/
UnrecognizedConfigProperty::UnrecognizedConfigProperty(const String& name)
    :Exception(
        MessageLoaderParms(
            "Config.ConfigExceptions.UNRECOGNIZED_CONFIG_PROPERTY",
            "Unrecognized config property: $0",
            name))
{
}
开发者ID:brunolauze,项目名称:pegasus,代码行数:11,代码来源:ConfigExceptions.cpp

示例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;
}
开发者ID:brunolauze,项目名称:pegasus,代码行数:48,代码来源:ProviderDirPropertyOwner.cpp

示例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);
}
开发者ID:kaixuanlive,项目名称:openpegasus,代码行数:9,代码来源:XmlParser.cpp


注:本文中的MessageLoaderParms函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。