您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

Apache Mina 学习笔记(4) - Filters

2024/3/8 22:14:51发布19次查看
iofilter是mina的另外一个核心部分,他为ioservice 和 iohandler filters所有的i/o事件和请求,类似于web中的servlet filter.
在本教程中,我们会开发一个实际例子中的iofilter,通常它很容易实现,但是你可能需要了解一些mina内部的细节。
下面是一些已经存在着的filter:
你可以继承ioadapter代替直接实现的iofilter,除非重写,否则任何接受到的事件都会被通过下面的filter:
public class myfilter extends iofilteradapter { @override public void sessionopened(nextfilter nextfilter, iosession session) throws exception { // some logic here... nextfilter.sessionopened(session); // some other logic here... } }
transforming a write request
be careful when filtering sessioncreated event
watch out the empty buffers!
以上就是 apache mina 学习笔记(4) - filters的内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product