what's MINA?
Apache
MINA is a network application framework which helps users develop high performance and high scalability network applications easily. It provides an abstract ·event-driven · asynchronous API over various transports such as TCP/IP and UDP/IP via Java NIO.
Apache MINA is often called:
* NIO framework · library,
* client · server framework · library, or
* a networking · socket library.
the architecture of MINA based application
a deeper dive into the details
Broadly, MINA based applications are divided into 3 layers
* I/O Service - Performs actual I/O
* I/O Filter Chain - Filters/Transforms bytes into desired Data Structures and vice-versa
* I/O Handler - Here resides the actual business logic
So, how to create a MINA based Application
1. Create I/O service - Choose from already available Services (*Acceptor) or create your own
2. Create Filter Chain - Choose from already existing Filters or create a custom Filter for transforming request/response
3. Create I/O Handler - Write business logic, on handling different messages
Server Architecture
We have seen, MINA based Application Architecture in previous section. Lets focus on Server Architecture. A Server listens on a port for incoming requests, process them and send replies.
* IOAcceptor listens on the network for incoming connections/packets
* For a new connection, a new session is created and all subsequent request from IP Address/Port combination are handled in that Session
* All packets received for a Session, traverses the Filter Chain as specified in the diagram. Filters can be used to modify the content of packets (like converting to Objects, adding/removing information etc). For converting to/from raw bytes to High Level Objects, PacketEncoder/Decoder are particularly useful
* Finally the packet or converted object lands in IOHandler. IOHandlers can be used to full fill business needs.
Client Architecture
We had a brief look at MINA based Server Architecture, lets see how Client looks like. Clients need to connect to a Server, send message and process the responses.
* Client first creates an IOConnector (MINA Construct for connecting to Socket), initiates a bind with Server
* Upon Connection creation, a Session is created and is associated with Connection
* Application/Client writes to the Session, resulting in data being sent to Server, after traversing the Filter Chain
* All the responses/messages received from Server are traverses the Filter Chain and lands at IOHandler, for processing
link to user-guide
- 大小: 27.8 KB
- 大小: 26.9 KB
- 大小: 32.6 KB
- 大小: 24.7 KB
分享到:
相关推荐
mina连接,mina心跳连接,mina断线重连。其中客户端可直接用在android上。根据各方参考资料,经过自己的理解弄出来的。CSDN的资源分太难得了。
mina的使用初步入门mina的使用初步入门mina的使用初步入门
里面包含mina2.0的api(英文)和mina自学手册,还有mina的开发指导
mina-core-2.0.0-M6.jar mina-example-2.0.0-M6.jar mina-filter-codec-netty-2.0.0-M6.jar mina-filter-compression-2.0.0-M6.jar mina-integration-beans-2.0.0-M6.jar mina-integration-jmx-2.0.0-M6.jar mina-...
mina的高级使用,mina文件图片传送,
深入理解Apache_Mina_(1)----_Mina的几个类 深入理解Apache_Mina_(2)----_与IoFilter相关的几个类 深入理解Apache_Mina_(3)----_与IoHandler相关的几个类 深入理解Apache_Mina_(4)----_IoFilter和IoHandler的区别和...
mina内部源码,可以深入的研究下,重构修改后获得的效率更加突出
mina demo
Apache MINA是 Apache 组织一个较新的项目,它为开发高性能和高可用性的网络应用程序提供了非常便利的框架。 当前发行的 MINA 版本支持基于 Java NIO 技术的 TCP/UDP 应用程序开发、串口通讯程序(只在最新的预览版...
mina运行最基本的demo,实现客户端输入数据的返回。其中还包含mina的jar包
mina.jar 包,内涵mina所需的所有jar包, 解压即可,测试可用。mina.jar 包,内涵mina所需的所有jar包, 解压即可,测试可用。
mina mina传输对象的示例 mina框架 mina示例
Apache Mina Server 2.0中文参考手册V1.0,Apache Mina2.0学习笔记(修订版)Apache Mina Server 2.0中文参考手册V1.0,Apache Mina2.0学习笔记(修订版)
mina源码
项目包含有mina的服务端与客户端,客户端发送心跳包,服务端响应心跳包
mina客户端,服务器端的demo
MINA开发文档总结,有如下内容Apache_Mina_Server_2.0中文参考手册V1.0.pdf 深入理解Apache_Mina.pdf MINA2官方教程翻译.pdf Mina2源码分析.pdf
mina2源码
apache mina 简单示例apache mina 简单示例apache mina 简单示例apache mina 简单示例apache mina 简单示例apache mina 简单示例
1.mina socket客户度工程相关类,添加mina jar包后可独立运行。 2.mina若有空闲连接则使用已有连接,若无则新建mina连接; 3.mina空闲连接超过保活时间25分钟后,自动删除; 4.mina发送指令后,接收指定时长内收到的...