Search in sources :

Example 1 with AbstractCollectDataHandler

use of com.creditease.agent.apm.api.AbstractCollectDataHandler in project uavstack by uavorg.

the class DefaultGatherDataHandler method handle.

@Override
public void handle(Message msg) {
    String jsonarr = msg.getParam(msg.getMessageType());
    List<CollectDataFrame> frames = JSONHelper.toObjectArray(jsonarr, CollectDataFrame.class);
    Set<AbstractCollectDataHandler> handlers = ConfigurationManager.getInstance().getComponents(AbstractCollectDataHandler.class);
    for (AbstractCollectDataHandler handler : handlers) {
        try {
            if (handler.isHandleable(msg.getMessageType())) {
                handler.handle(frames);
            }
        } catch (Exception e) {
            log.err(this, "gather data handler failed. msgType:" + msg.getMessageType() + ", handler: " + handler.getName(), e);
        }
    }
}
Also used : AbstractCollectDataHandler(com.creditease.agent.apm.api.AbstractCollectDataHandler) CollectDataFrame(com.creditease.agent.apm.api.CollectDataFrame)

Aggregations

AbstractCollectDataHandler (com.creditease.agent.apm.api.AbstractCollectDataHandler)1 CollectDataFrame (com.creditease.agent.apm.api.CollectDataFrame)1