【知识点】:
1.任务中心主要支持以条件触发为特点的业务预警和后台异步处理的后台自动任务两类。
2.业务预警:在项目运行中,及时合理的对业务过程进行监控。
3.后台任务:异步处理,提高系统运行效率。主要用来完成大部分耗时的、周期性处理的业务处理过程。
4.任务中心根据注册的任务类型的不同,系统提供的(预警条目配置)和(后台任务部署)。对应上面2种
【运用实例demo】:使用“业务预警”对zpt用户登录进行监控
1.任务类型注册
2.预警条件配置
3.创建业务插件
Business类的主要内容:
package nc.bs.hello.Plugin;
import nc.bs.pub.pa.IBusinessPlugin;
import nc.bs.pub.pa.html.IAlertMessage;
import nc.ui.pub.beans.MessageDialog;
import nc.vo.pub.BusinessException;
import nc.vo.pub.lang.UFDate;
import nc.vo.pub.pa.Key;
public class BusinessPlugin implements IBusinessPlugin{
public int getImplmentsType() {
// TODO Auto-generated method stub
return IBusinessPlugin.IMPLEMENT_RETURNMESSAGE;//0
}
public Key[] getKeys() {
// TODO Auto-generated method stub
return null;
}
public String getTypeDescription() {
// TODO Auto-generated method stub
return null;
}
public String getTypeName() {
// TODO Auto-generated method stub
return null;
}
public IAlertMessage implementReturnFormatMsg(Key[] keys, String corpPK,
UFDate clientLoginDate) throws BusinessException {
// TODO Auto-generated method stub
return null;
}
public String implementReturnMessage(Key[] keys, String corpPK,
UFDate clientLoginDate) throws BusinessException {
// TODO Auto-generated method stub
// MessageDialog.showErrorDlg(null, "后台消息", "哇~郑培涛,登陆了耶");
System.out.println("【预警处理消息。。。。】");
return "【返回:预警处理消息,zpt登陆了】";
}
public Object implementReturnObject(Key[] keys, String corpPK,
UFDate clientLoginDate) throws BusinessException {
// TODO Auto-generated method stub
return null;
}
public boolean implementWriteFile(Key[] keys, String fileName,
String corpPK, UFDate clientLoginDate) throws BusinessException {
// TODO Auto-generated method stub
return false;
}
}