public void initializeBeans() { alertRule = new AlertRule(/*.省略参数.*/); //省略一些初始化代码 notification = new Notification(/*.省略参数.*/); //省略一些初始化代码 alert = new AlertOCP(); alert.addAlertHandler(new TpsAlertHandler(alertRule, notification)); alert.addAlertHandler(new ErrorAlertHandler(alertRule, notification)); alert.addAlertHandler(new TimeoutAlertHandler(alertRule, notification));//新增逻辑 }
public ErrorAlertHandler(AlertRule rule, Notification notification) : base(rule, notification) { }
public Alert(AlertRule rule, Notification notification) { this.rule = rule; this.notification = notification; }
public TimeoutAlertHandler(AlertRule rule, Notification notification) : base(rule, notification) { }