use of com.creditease.agent.spi.AgentResourceComponent in project uavstack by uavorg.
the class NodeInfoDataMessageHandler method handle.
@Override
public void handle(Message msg) {
super.handle(msg);
// NOW, we send out the MDF for runtime notification
AgentResourceComponent arc = (AgentResourceComponent) ConfigurationManager.getInstance().getComponent("messageproducer", "MessageProducerResourceComponent");
MessageProducer producer = (MessageProducer) arc.getResource();
if (producer != null) {
String runtimeKey = MonitorDataFrame.MessageType.RuntimeNtf.toString();
Message rtntfmsg = MessagingFactory.createMessage(runtimeKey);
String dataStream = msg.getParam(this.getMsgTypeName());
rtntfmsg.setParam(runtimeKey, dataStream);
boolean check = producer.submit(rtntfmsg);
String sendState = runtimeKey + " Data Sent " + (check ? "SUCCESS" : "FAIL");
if (log.isDebugEnable()) {
log.debug(this, sendState + " " + dataStream);
}
}
}
Aggregations