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

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.

主站蜘蛛池模板: 郓城县| 含山县| 海城市| 文山县| 平塘县| 福海县| 贵定县| 百色市| 望江县| 紫阳县| 晋江市| 宜君县| 含山县| 布拖县| 博野县| 阳西县| 吴桥县| 宜宾市| 昌黎县| 泸溪县| 太保市| 桂阳县| 石台县| 丽江市| 清徐县| 嘉定区| 韶关市| 桐庐县| 自治县| 丰镇市| 砀山县| 金华市| 枝江市| 临高县| 东城区| 措勤县| 会宁县| 黄大仙区| 武平县| 安达市| 清苑县|