前面分析了下Openfire Plugin插件: https://www.zhblog.net/go/java/openfire/plugin-run-time?t=638
现在看下Openfire中另一个核心:Handler。
handler其实和plugin是很类似的。
首先,Interceptor的过滤是不变的。然后message会经过我们自定义的Plugin插件,而iq消息则经过我们自定义的handler。
message消息对应 MessageRouter。
iq消息对应 IQRouter。与message查找Plugin类似,handler是根据 namespace 来查找的。
namespace 定义在初始化Handler时:
new IQHandlerInfo("query", "linktime:iq:history");