bool PropertyConfigurator::doConfigure(const QString &rConfigFileName,
                                           LoggerRepository *pLoggerRepository)
	{
        startCaptureErrors();
		configureFromFile(rConfigFileName, pLoggerRepository);
        return stopCaptureErrors();
	}
Example #2
0
jvxErrorType
jvxIosCppHost::initialize(callback bwd_cb, void* priv_cb, const char* fName_config)
{
    jvxErrorType res = JVX_NO_ERROR;
    jvxComponentType cpType = JVX_COMPONENT_UNKNOWN;
    bool multObj = false;
    char* argv_loc[2];
    int argc_loc = 2;
    
    if(!hasBeenInitializedBefore)
    {
        bwd_ref.cb_entry = bwd_cb;
        bwd_ref.cb_private = priv_cb;
        
        /* ========================================================
         * Obtain access to host referece in library
         *========================================================*/
        res = jvxHJvx_nd_init(&theSystemRefs.hObject);
        
        // ======================================================
        // Get pointer access to host object
        // ======================================================
        theSystemRefs.hObject->request_specialization(
                                                      (jvxHandle**)&theSystemRefs.hHost,
                                                      &cpType, &multObj);
        
        // ======================================================
        // Check component type of specialization
        // ======================================================
        if(theSystemRefs.hHost && (cpType == JVX_COMPONENT_HOST))
        {
            
            // ======================================================
            // Initialize the host..
            // ======================================================
            
            theSystemRefs.hHost->initialize(NULL);
            theSystemRefs.hHost->select();
            
            // Set cross references such that all report callbacks end up in this class
            theSystemRefs.hHost->set_external_report_target(static_cast<IjvxReport*>(this));
            
            // ++++++++++++++++++++++++++++++++++++++++++++++++++++
            // bootup phase BEFORE config file has been processed
            // ++++++++++++++++++++++++++++++++++++++++++++++++++++
            
            // Project pecific part of boot code
            res = bootup_specific();
            if(res != JVX_NO_ERROR)
            {
                assert(0);
            }
            
            // ++++++++++++++++++++++++++++++++++++++++++++++++++++
            // Activate the host
            // ++++++++++++++++++++++++++++++++++++++++++++++++++++
            
            res = theSystemRefs.hHost->activate();
            if(res != JVX_NO_ERROR)
            {
                assert(0);
            }
            
            // ++++++++++++++++++++++++++++++++++++++++++++++++++++
            // Handle confguration files
            // ++++++++++++++++++++++++++++++++++++++++++++++++++++
            
            // Obtain access to tools interfaces
            res = theSystemRefs.hHost->request_hidden_interface(JVX_INTERFACE_TOOLS_HOST, reinterpret_cast<jvxHandle**>(&theSystemRefs.hTools));
            if(res != JVX_NO_ERROR)
            {
                assert(0);
            }
            
            // If config file was specified, start configuration from file
            if(fName_config)
            {
                configureFromFile(fName_config);
            }
            
            // ++++++++++++++++++++++++++++++++++++++++++++++++++++
            // bootup phase AFTER config file has been processed
            // ++++++++++++++++++++++++++++++++++++++++++++++++++++
            
            res = bootup_finalize_specific();
            if(res != JVX_NO_ERROR)
            {
                assert(0);
            }
            hasBeenInitializedBefore = true;
        }
        else
        {
            res = JVX_ERROR_UNEXPECTED;
        }
    }
    else
    {
        res = JVX_ERROR_WRONG_STATE;
    }
    return(res);
}