Search in sources :

Example 1 with StopScript

use of org.opennms.netmgt.config.scriptd.StopScript in project opennms by OpenNMS.

the class Executor method stop.

public synchronized void stop() {
    // Shut down the event listener
    if (m_broadcastEventProcessor != null) {
        m_broadcastEventProcessor.close();
    }
    m_broadcastEventProcessor = null;
    // Shut down the thread pool
    m_executorService.shutdown();
    // Run all stop scripts
    for (final StopScript stopScript : m_config.getStopScripts()) {
        if (stopScript.getContent().isPresent()) {
            try {
                m_scriptManager.exec(stopScript.getLanguage(), "", 0, 0, stopScript.getContent().get());
            } catch (BSFException e) {
                LOG.error("Stop script failed: " + stopScript, e);
            }
        } else {
            LOG.warn("Stop script has no script contents: " + stopScript);
        }
    }
    LOG.debug("Scriptd executor stopped");
}
Also used : BSFException(org.apache.bsf.BSFException) StopScript(org.opennms.netmgt.config.scriptd.StopScript)

Aggregations

BSFException (org.apache.bsf.BSFException)1 StopScript (org.opennms.netmgt.config.scriptd.StopScript)1