官术网_书友最值得收藏!

Admin email handler

The AdminEmailHandler class extends the MainEmailHandler class. Unlike the other classes, it does not assign any keywords specific to the admin email handler. If an email is sent to this handler, the last one in the chain of responsibility, it will process the email and inform the user via the processEmailFinal() method:

public class AdminEmailHandler extends MainEmailHandler {

protected String[] keyWords() {
// Here it does not matter what the keywords are
return new String[0];
}

protected void processEmailFinal(String emailText) {
System.out.println("The Admin Team processed the email.");
}

@Override
public void setNextEmailHandler(UniversityEmailHandler emailHandler) {

}
}

The processEmailFinal() method just shown informs the user that the admin email handler took care of the received email.

This section featured the university email system's source code, demonstrating the chain of responsibility design pattern.

主站蜘蛛池模板: 沁水县| 泸水县| 平度市| 金坛市| 云梦县| 昆明市| 区。| 长乐市| 沂源县| 枣阳市| 怀化市| 绥江县| 南宫市| 赣榆县| 天气| 河东区| 西青区| 灵璧县| 涟水县| 鸡泽县| 斗六市| 互助| 民丰县| 温泉县| 威远县| 邓州市| 淄博市| 运城市| 宜良县| 锦屏县| 安陆市| 九台市| 民乐县| 上思县| 西丰县| 股票| 柳州市| 邹城市| 茌平县| 左贡县| 辉县市|