Search in sources :

Example 1 with ScriptdConfigFactory

use of org.opennms.netmgt.config.ScriptdConfigFactory in project opennms by OpenNMS.

the class Scriptd method onInit.

/**
     * Initialize the <em>Scriptd</em> service.
     */
@Override
protected void onInit() {
    // Load the configuration information
    //
    ScriptdConfigFactory aFactory = null;
    try {
        ScriptdConfigFactory.reload();
        aFactory = ScriptdConfigFactory.getInstance();
    } catch (IOException ex) {
        LOG.error("Failed to load scriptd configuration", ex);
        throw new UndeclaredThrowableException(ex);
    }
    // get the node DAO
    BeanFactoryReference bf = BeanUtils.getBeanFactory("daoContext");
    NodeDao nodeDao = BeanUtils.getBean(bf, "nodeDao", NodeDao.class);
    m_executor = new Executor(aFactory, nodeDao);
}
Also used : BeanFactoryReference(org.springframework.beans.factory.access.BeanFactoryReference) NodeDao(org.opennms.netmgt.dao.api.NodeDao) UndeclaredThrowableException(java.lang.reflect.UndeclaredThrowableException) ScriptdConfigFactory(org.opennms.netmgt.config.ScriptdConfigFactory) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)1 UndeclaredThrowableException (java.lang.reflect.UndeclaredThrowableException)1 ScriptdConfigFactory (org.opennms.netmgt.config.ScriptdConfigFactory)1 NodeDao (org.opennms.netmgt.dao.api.NodeDao)1 BeanFactoryReference (org.springframework.beans.factory.access.BeanFactoryReference)1