Package com.foxinmy.weixin4j.interceptor
Class MessageInterceptorAdapter
- java.lang.Object
-
- com.foxinmy.weixin4j.interceptor.MessageInterceptorAdapter
-
- All Implemented Interfaces:
WeixinMessageInterceptor
public abstract class MessageInterceptorAdapter extends Object implements WeixinMessageInterceptor
消息拦截适配- Since:
- JDK 1.6
- Author:
- jinyu(foxinmy@gmail.com)
-
-
Constructor Summary
Constructors Constructor Description MessageInterceptorAdapter()
-
Method Summary
All Methods Instance Methods Concrete 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
public boolean preHandle(io.netty.channel.ChannelHandlerContext context, WeixinRequest request, WeixinMessage message, WeixinMessageHandler handler)
Description copied from interface:WeixinMessageInterceptor
执行handler前- Specified by:
preHandle
in interfaceWeixinMessageInterceptor
- Parameters:
context
- 通道环境request
- 微信请求message
- 微信消息handler
- 消息处理器- Returns:
- 返回true执行下一个拦截器
-
postHandle
public void postHandle(io.netty.channel.ChannelHandlerContext context, WeixinRequest request, WeixinResponse response, WeixinMessage message, WeixinMessageHandler handler)
Description copied from interface:WeixinMessageInterceptor
执行handler后- Specified by:
postHandle
in interfaceWeixinMessageInterceptor
- Parameters:
context
- 通道环境request
- 微信请求response
- 微信响应message
- 微信消息handler
- 消息处理器
-
afterCompletion
public void afterCompletion(io.netty.channel.ChannelHandlerContext context, WeixinRequest request, WeixinResponse response, WeixinMessage message, WeixinMessageHandler handler, Exception exception)
Description copied from interface:WeixinMessageInterceptor
全部执行后- Specified by:
afterCompletion
in interfaceWeixinMessageInterceptor
- Parameters:
context
- 通道环境request
- 微信请求message
- 微信消息handler
- 消息处理器exception
- 执行异常
-
weight
public int weight()
Description copied from interface:WeixinMessageInterceptor
用于匹配到多个MessageHandler时权重降序排列,数字越大优先级越高- Specified by:
weight
in interfaceWeixinMessageInterceptor
- Returns:
- 权重
-
-