Package com.foxinmy.weixin4j.interceptor
Interface WeixinMessageInterceptor
-
- All Known Implementing Classes:
MessageInterceptorAdapter
public interface WeixinMessageInterceptor
微信消息拦截器- Since:
- JDK 1.6
- Author:
- jinyu(foxinmy@gmail.com)
- See Also:
MessageInterceptorAdapter
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
afterCompletion(io.netty.channel.ChannelHandlerContext context, WeixinRequest request, WeixinResponse response, WeixinMessage message, WeixinMessageHandler handler, Exception exception)
全部执行后void
postHandle(io.netty.channel.ChannelHandlerContext context, WeixinRequest request, WeixinResponse response, WeixinMessage message, WeixinMessageHandler handler)
执行handler后boolean
preHandle(io.netty.channel.ChannelHandlerContext context, WeixinRequest request, WeixinMessage message, WeixinMessageHandler handler)
执行handler前int
weight()
用于匹配到多个MessageHandler时权重降序排列,数字越大优先级越高
-
-
-
Method Detail
-
preHandle
boolean preHandle(io.netty.channel.ChannelHandlerContext context, WeixinRequest request, WeixinMessage message, WeixinMessageHandler handler)
执行handler前- Parameters:
context
- 通道环境request
- 微信请求message
- 微信消息handler
- 消息处理器- Returns:
- 返回true执行下一个拦截器
- Throws:
WeixinException
-
postHandle
void postHandle(io.netty.channel.ChannelHandlerContext context, WeixinRequest request, WeixinResponse response, WeixinMessage message, WeixinMessageHandler handler)
执行handler后- Parameters:
context
- 通道环境request
- 微信请求response
- 微信响应message
- 微信消息handler
- 消息处理器- Throws:
WeixinException
-
afterCompletion
void afterCompletion(io.netty.channel.ChannelHandlerContext context, WeixinRequest request, WeixinResponse response, WeixinMessage message, WeixinMessageHandler handler, Exception exception)
全部执行后- Parameters:
context
- 通道环境request
- 微信请求message
- 微信消息handler
- 消息处理器exception
- 执行异常- Throws:
WeixinException
-
weight
int weight()
用于匹配到多个MessageHandler时权重降序排列,数字越大优先级越高- Returns:
- 权重
-
-