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

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.

主站蜘蛛池模板: 义马市| 惠来县| 静宁县| 英超| 南丰县| 九龙县| 白沙| 手游| 富平县| 辛集市| 崇信县| 赤水市| 陈巴尔虎旗| 进贤县| 介休市| 彩票| 鄂尔多斯市| 宜春市| 盈江县| 抚远县| 谷城县| 淮南市| 德格县| 黑河市| 西峡县| 宝清县| 葵青区| 涡阳县| 泰顺县| 大方县| 莱芜市| 高青县| 集安市| 阜新| 江达县| 灯塔市| 景东| 确山县| 河津市| 湖口县| 南漳县|