/** * Method that updates info in List nodes and also save info into database. This method is called * by SnmpCollection after all stuff is done * * @param snmpcoll */ @Transactional public void updateNodeSnmpCollection(final SnmpCollection snmpcoll) { LogUtils.debugf( this, "Updating SNMP collection for %s", InetAddressUtils.str(snmpcoll.getTarget())); LinkableNode node = removeNode(snmpcoll.getTarget()); if (node == null) { LogUtils.errorf( this, "No node found for SNMP collection: %s unscheduling!", snmpcoll.getInfo()); m_scheduler.unschedule(snmpcoll); return; } try { node = m_queryMgr.storeSnmpCollection(node, snmpcoll); } catch (SQLException e) { LogUtils.errorf( this, e, "Failed to save on db snmpcollection/package: %s/%s", snmpcoll.getPackageName(), snmpcoll.getInfo()); return; } if (node != null) { synchronized (m_nodes) { m_nodes.add(node); } } }
/** onStop */ protected synchronized void onStop() { // Stop the scheduler m_scheduler.stop(); m_scheduler = null; }
/** onStart */ protected synchronized void onStart() { // start the scheduler // LogUtils.debugf(this, "start: Starting linkd scheduler"); m_scheduler.start(); // Set the status of the service as running. // }
private ReadyRunnable getReadyRunnable(ReadyRunnable runnable) { LogUtils.debugf( this, "getReadyRunnable: get ReadyRunnable from scheduler: %s", runnable.getInfo()); return m_scheduler.getReadyRunnable(runnable); }
/** onResume */ protected synchronized void onResume() { m_scheduler.resume(); }
/** onPause */ protected synchronized void onPause() { m_scheduler.pause(); }