Search in sources :

Example 1 with ISystemActionEngineMgr

use of com.creditease.agent.spi.ISystemActionEngineMgr in project uavstack by uavorg.

the class SystemStarter method createSystemActionEngineMgr.

private ISystemActionEngineMgr createSystemActionEngineMgr() {
    ISystemActionEngineMgr saem = new SystemActionEngineMgr();
    this.configMgr.registerComponent("Global", "ISystemActionEngineMgr", saem);
    log.info(this, "System ActionEngine Manager created");
    return saem;
}
Also used : ISystemActionEngineMgr(com.creditease.agent.spi.ISystemActionEngineMgr) SystemActionEngineMgr(com.creditease.agent.workqueue.SystemActionEngineMgr) ISystemActionEngineMgr(com.creditease.agent.spi.ISystemActionEngineMgr)

Example 2 with ISystemActionEngineMgr

use of com.creditease.agent.spi.ISystemActionEngineMgr in project uavstack by uavorg.

the class ProfileDataMessageHandler method pushLatestProfileDataToCacheCenter.

/**
 * 推送最新的ProfileData到缓存中心
 *
 * @param profileString
 */
private List<String> pushLatestProfileDataToCacheCenter(String profileString) {
    /**
     * setup ProfileDataMessageHandler as IStandardProfileModelListener for StandardProfileModeler
     */
    ISystemActionEngineMgr engineMgr = (ISystemActionEngineMgr) ConfigurationManager.getInstance().getComponent("Global", "ISystemActionEngineMgr");
    IActionEngine engine = engineMgr.getActionEngine("StandardProfileModelingEngine");
    StandardProfileModeler modeler = (StandardProfileModeler) ConfigurationManager.getInstance().getComponent("healthmanager", "StandardProfileModeler");
    modeler.setListener(this);
    cm.beginBatch();
    List<String> monitorDataFrames = JSONHelper.toObjectArray(profileString, String.class);
    List<String> newMDFs = new ArrayList<String>();
    for (String mdfStr : monitorDataFrames) {
        MonitorDataFrame mdf = new MonitorDataFrame(mdfStr);
        ActionContext ac = new ActionContext();
        ac.putParam(MonitorDataFrame.class, mdf);
        ac.putParam("NewMDFList", newMDFs);
        ac.putParam("MDFString", mdfStr);
        engine.execute("StandardProfileModeler", ac);
    }
    cm.submitBatch();
    return newMDFs;
}
Also used : ISystemActionEngineMgr(com.creditease.agent.spi.ISystemActionEngineMgr) ArrayList(java.util.ArrayList) StandardProfileModeler(com.creditease.agent.profile.api.StandardProfileModeler) MonitorDataFrame(com.creditease.agent.monitor.api.MonitorDataFrame) ActionContext(com.creditease.agent.spi.ActionContext) IActionEngine(com.creditease.agent.spi.IActionEngine)

Aggregations

ISystemActionEngineMgr (com.creditease.agent.spi.ISystemActionEngineMgr)2 MonitorDataFrame (com.creditease.agent.monitor.api.MonitorDataFrame)1 StandardProfileModeler (com.creditease.agent.profile.api.StandardProfileModeler)1 ActionContext (com.creditease.agent.spi.ActionContext)1 IActionEngine (com.creditease.agent.spi.IActionEngine)1 SystemActionEngineMgr (com.creditease.agent.workqueue.SystemActionEngineMgr)1 ArrayList (java.util.ArrayList)1