// 该方法已经不用,由SendMessage方法替代其功能 [ ChengKang 2014-07-16 16:03:30 ] @Scheduled(fixedDelay = 2000) public void sendQuotes() { List<TagInfo> taginfos = TaginfoCollection.getList(); List<AlarmsInfo> taginfos2 = TaginfoCollection.getList2(); if (taginfos != null && taginfos.size() > 0) { for (TagInfo taginfo : taginfos) { // logger.info(taginfo); if (logger.isTraceEnabled()) { // logger.trace("Sending taginfo " + taginfo); } if (this.brokerAvailable.get()) { this.messagingTemplate.convertAndSend("/topic/value.tag." + taginfo.getId(), taginfo); } } // 链表数据发送完毕,执行清空 taginfos.clear(); } if (taginfos2 != null && taginfos2.size() > 0) { for (AlarmsInfo alarmsInfo : taginfos2) { // logger.info(alarmsInfo); if (logger.isTraceEnabled()) { // logger.trace("Sending alarmsInfo " + alarmsInfo); } if (this.brokerAvailable.get()) { this.messagingTemplate.convertAndSend( "/topic/value.tag." + alarmsInfo.getTagID(), alarmsInfo); } } taginfos2.clear(); } }
// 发送alarminfo信息 [ ChengKang 2014-07-16 ] public void SendAlarm(AlarmsInfo alarmInfo) { // logger.info(alarmInfo); if (logger.isTraceEnabled()) { // logger.trace("Sending alarmsInfo " + alarmInfo); } if (this.brokerAvailable.get()) { this.messagingTemplate.convertAndSend("/topic/value.tag." + alarmInfo.getTagID(), alarmInfo); } }