src/common/modfactory.cpp
void ModuleFactory::load(const std::string& id)
{
    try
    {
        // create module instance
        IModulePtr module = getModule4Start(id);
        BOOST_ASSERT(module);

        // before load this module we should load all it's dependency
        StringList deps = m_dependency.getDependency(id);
        for (StringList::iterator i = deps.begin(); i != deps.end(); i++)
        {
            load(*i);
        }

        // start the thread
        startModuleThread(module);

        // wait until it will be really started
        time_t timeout = 60; // FIXME!!!  add to somewhere
        module->waitStart(timeout);
    }
    catch(const std::exception& err)
    {
        m_factory->getSNMP()->sendTrap(snmp::MODULE_LOAD_FAILED,
                                       id);

        klk_log(KLKLOG_ERROR, "Failed to load module '%s': %s",
                id.c_str(),
                err.what());
        throw;
    }
}
// Loads a module by its id
// @param[in] id the module id
Loads a module by its id
Loads a module by its id
void ModuleFactory::load(const std::string& id)
{
    try
    {
        IModulePtr module = getModule4Start(id);
        BOOST_ASSERT(module);
        StringList deps = m_dependency.getDependency(id);
        for (StringList::iterator i = deps.begin(); i != deps.end(); i++)
        {
            load(*i);
        }
        startModuleThread(module);
        time_t timeout = 60; 
        module->waitStart(timeout);
    }
    catch(const std::exception& err)
    {
        m_factory->getSNMP()->sendTrap(snmp::MODULE_LOAD_FAILED,
                                       id);
        klk_log(KLKLOG_ERROR, "Failed to load module '%s': %s",
                id.c_str(),
                err.what());
        throw;
    }
}
void ModuleFactory :: load ( const std :: string & id ) { try { IModulePtr module = getModule4Start ( id ) ; BOOST_ASSERT ( module ) ; StringList deps = m_dependency . getDependency ( id ) ; for ( StringList :: iterator i = deps . begin ( ) ; i != deps . end ( ) ; i ++ ) { load ( * i ) ; } startModuleThread ( module ) ; time_t timeout = 60 ; module -> waitStart ( timeout ) ; } catch ( const std :: exception & err ) { m_factory -> getSNMP ( ) -> sendTrap ( snmp :: MODULE_LOAD_FAILED , id ) ; klk_log ( KLKLOG_ERROR , " " , id . c_str ( ) , err . what ( ) ) ; throw ; } }
Loads a module by its id
Loads a module by its id
// create module instance // before load this module we should load all it's dependency // start the thread // wait until it will be really started // FIXME!!!  add to somewhere