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 voidafterCompletion(io.netty.channel.ChannelHandlerContext context, WeixinRequest request, WeixinResponse response, WeixinMessage message, WeixinMessageHandler handler, Exception exception)全部执行后voidpostHandle(io.netty.channel.ChannelHandlerContext context, WeixinRequest request, WeixinResponse response, WeixinMessage message, WeixinMessageHandler handler)执行handler后booleanpreHandle(io.netty.channel.ChannelHandlerContext context, WeixinRequest request, WeixinMessage message, WeixinMessageHandler handler)执行handler前intweight()用于匹配到多个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:
preHandlein 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:
postHandlein 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:
afterCompletionin interfaceWeixinMessageInterceptor- Parameters:
context- 通道环境request- 微信请求message- 微信消息handler- 消息处理器exception- 执行异常
-
weight
public int weight()
Description copied from interface:WeixinMessageInterceptor用于匹配到多个MessageHandler时权重降序排列,数字越大优先级越高- Specified by:
weightin interfaceWeixinMessageInterceptor- Returns:
- 权重
-
-