Package com.zone.weixin4j.interceptor
Class MessageInterceptorAdapter
- java.lang.Object
-
- com.zone.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(WeixinRequest request, WeixinResponse response, WeixinMessage message, WeixinMessageHandler handler, Exception exception)
全部执行后void
postHandle(WeixinRequest request, WeixinResponse response, WeixinMessage message, WeixinMessageHandler handler)
执行handler后boolean
preHandle(WeixinRequest request, WeixinMessage message, WeixinMessageHandler handler)
执行handler前int
weight()
用于匹配到多个MessageHandler时权重降序排列,数字越大优先级越高
-
-
-
Method Detail
-
preHandle
public boolean preHandle(WeixinRequest request, WeixinMessage message, WeixinMessageHandler handler) throws WeixinException
Description copied from interface:WeixinMessageInterceptor
执行handler前- Specified by:
preHandle
in interfaceWeixinMessageInterceptor
- Parameters:
request
- 微信请求message
- 微信消息handler
- 消息处理器- Returns:
- 返回true执行下一个拦截器
- Throws:
WeixinException
-
postHandle
public void postHandle(WeixinRequest request, WeixinResponse response, WeixinMessage message, WeixinMessageHandler handler) throws WeixinException
Description copied from interface:WeixinMessageInterceptor
执行handler后- Specified by:
postHandle
in interfaceWeixinMessageInterceptor
- Parameters:
request
- 微信请求response
- 微信响应message
- 微信消息handler
- 消息处理器- Throws:
WeixinException
-
afterCompletion
public void afterCompletion(WeixinRequest request, WeixinResponse response, WeixinMessage message, WeixinMessageHandler handler, Exception exception) throws WeixinException
Description copied from interface:WeixinMessageInterceptor
全部执行后- Specified by:
afterCompletion
in interfaceWeixinMessageInterceptor
- Parameters:
request
- 微信请求message
- 微信消息handler
- 消息处理器exception
- 执行异常- Throws:
WeixinException
-
weight
public int weight()
Description copied from interface:WeixinMessageInterceptor
用于匹配到多个MessageHandler时权重降序排列,数字越大优先级越高- Specified by:
weight
in interfaceWeixinMessageInterceptor
- Returns:
- 权重
-
-