/** * Stop method of fiber, called by OpenNMS when fiber execution is to finish. Its purpose is to * clean everything up, e.g. close any JNDI or database connections, before the fiber's execution * is ended. */ @Override protected void onStop() { // Get a reference to the QoSD logger LOG.info("Stopping QosD"); try { unregisterListener(); // unregister the OpenNMS event listener } catch (Throwable ex) { LOG.error("stop() Error unregistering the OpenNMS event listener. Error:", ex); } try { openNMSEventHandlerThread.kill(); } catch (Throwable ex) { LOG.error("stop() Error killing openNMSEventHandlerThread. Error:", ex); } try { alarmListConnectionManager.kill(); // kill the connection thread } catch (Throwable ex) { LOG.error("stop() Error killing alarmListConnectionManager. Error:", ex); } LOG.info("QosD Stopped"); }