Search in sources :

Example 6 with AgentResourceComponent

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);
        }
    }
}
Also used : Message(com.creditease.uav.messaging.api.Message) AgentResourceComponent(com.creditease.agent.spi.AgentResourceComponent) MessageProducer(com.creditease.uav.messaging.api.MessageProducer)

Aggregations

AgentResourceComponent (com.creditease.agent.spi.AgentResourceComponent)6 Message (com.creditease.uav.messaging.api.Message)4 MessageProducer (com.creditease.uav.messaging.api.MessageProducer)4 AgentFeatureComponent (com.creditease.agent.spi.AgentFeatureComponent)1 URLClassLoader (java.net.URLClassLoader)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 Entry (java.util.Map.Entry)1 Properties (java.util.Properties)1