link.jfire.socket.socketserver.interceptor.MessageInterceptor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jfire-socket Show documentation
Show all versions of jfire-socket Show documentation
Jfire - socket is a server-side framework based on AIO. Users only need a simple implementation of a business logic processing interface can be the business data processing. The framework provides the client and server at the same time. Have strong connection capacity. Single server provides tens of thousands of connections.
The newest version!
package link.jfire.socket.socketserver.interceptor;
import link.jfire.baseutil.order.Order;
import link.jfire.socket.socketserver.bus.Message;
public interface MessageInterceptor extends Order
{
/*
* 拦截器动作正常,传递到下一个拦截器
*/
public final static int next = 1;
/*
* 处理中断,拦截器的使用只到本拦截器为止。参与后续的信息处理,以及出口拦截器拦截。
* 并且出口拦截器拦截时是从本拦截器开始到源头结束
*/
public final static int end = 2;
/**
* 拦截中断,没有消息处理器的处理,直接进行后续的行为,也就是出口拦截器的处理
*/
public final static int interceptored = 3;
/**
* 出现错误情况,拦截器指示MessageAction进行通道关闭
*/
public final static int closed = 4;
/**
* 消息进入处理器的拦截处理,并且返回处理结果。
* 处理的内容在businessData中。start的位置在0
*
* @param message
* @return
*/
public int inInterceptor(Message message);
/**
* 消息离开处理器,发送出去前的拦截处理,返回处理结果。
* 处理的内容在businessData。start的位置在0
*
* @param message
* @return
*/
public int outInterceptor(Message message);
}