Title: Introduction%20to%20MINA
1Introduction to MINA
- Trustin Lee
- trustin_at_apache.org
- http//people.apache.org/trustin/
2Agenda
- Overview
- In-depth View
- Implementation Demo
- Future
- Conclusion
3Overview
- A Multipurpose Infrastructure for Network
Applications
4What is MINA?
Overview
- An acronym for
- A Multipurpose
- Infrastructure
- For Network
- Applications
- A network application framework
- A subproject of
- the Apache Directory Project
5Features
Overview
- Unified API
- Easy
- Event-driven
- Abstracted from existing I/O APIs
- Elegant application design
6Supported Transport Layers
Overview
- Out-of-the-box
- Based on Java NIO (New I/O)
- Socket (TCP/IP)
- Datagram (UDP/IP)
- In-VM pipe
- Pending
- Multicast
- Serial and parallel port
- ltyour favorite onegt
7Elegant Application Design
Overview
- Unit test friendly
- The Abstract API lets you test your application
without a real client or server via mock objects. - Extensible
- Runtime modification of application behavior
using filters - Maintainable and Reusable
- Separation of networking code (MINA), protocol
codec, and business logic
With High Productivity
8Who Uses MINA?
Overview
- The Apache Directory Project
- QuickFIX QuickFIXEngine.org
- Financial Information eXchange Protocol
- RED5 Server OSFlash.org
- Macromedia Flash Media RTMP
- JStyx JStyx.sf.net
- Styx, a file sharing NFS-like protocol
- Proprietary SMPP / SMS servers
LDAP Kerberos DNS NTP
9In-depth View
- A Multipurpose Infrastructure for Network
Applications
10At the First Glance
In-depth
- IoSessionManager
- Where real I/O occurs
- Generates I/O events
- Processes I/O requests
- IoFilters
- Filters I/O events and requests
- IoHandler
- ltYour protocol logicgt
- IoSession
- Represents a connection
11IoSessionManagers
In-depth
Server-sideAccepts clients
Client-sideConnects to a server
And their implementations
12IoSession
In-depth
- A connection between an IoHandler and a remote
peer - Provides ways to send an I/O request
- Write a message
- Close the current connection
- State information
- Idleness
- Last I/O time
- Transport layer parameters
- Attributes Protocol-specific data storage
13IoHandler
In-depth
- Where you implement your network application
14IoFilter
In-depth
- A reusable event request interceptor
- Hot-deployable
- Scope
- An IoSession or an IoSessionManager
15IoFilter (Contd)
In-depth
- Out-of-the box filters
- SSL / TLS
- Remote peer blacklisting
- Thread pool
- Logger
- Pending filters
- Profiler
- Traffic throttle
- Lightweight firewall
- Overload prevention
16Thread Pooling with IoFilter
In-depth
17Protocol Codec
In-depth
- By default,
- IoHandler uses a ByteBuffer to do I/O
- Tight coupling of protocol codec and business
logic ( - ProtocolCodecFilter is an IoFilter
- Performs transformation betweena ByteBuffer and
a POJO (Plain Old Java Object) - Clear separation
18Protocol Codec (Contd)
In-depth
19In-VM Pipe Transport Type
In-depth
- A virtual pipe
- Requires no protocol codec
- I/O events and requests are converted into direct
method invocations. - Two MINA servers in the same VM
- Can bypass
- Protocol codec
- Network latency
20Implementation Demo
- A Multipurpose Infrastructure for Network
Applications
21More Complex Examples
Demo
- Realistic examples
- Visit Herehttp//directory.apache.org
/subprojects/network/getting_started.html
22Future
- A Multipurpose Infrastructure for Network
Applications
23MINA as a Platform
Future
Integration with Apache ASN.1 for complex
protocols
Users can build customized servers with
ready-made protocol codecs.
Just like drawing an ER Diagrams!
24Real-Time Management System
Future
- A universal management view
- JMX console and Web browser
- Real time access
- Server traffic
- IoFilter Hot-deploy
- Which client is sending what message now?
- Which message takes toolong to process?
- And ltwhat you want to monitorgt
25We Need Your Participation!
Future
- Sounds exciting?
- Please help MINA team!
- Try MINA
- Ask questions
- Criticize
- Report bugs
- Benchmark
- Contribute code
- Contribute a tutorial
26Conclusion
- A Multipurpose Infrastructure for Network
Applications
27Conclusion
Conclusion
- MINA is an extensible network application
framework that helps you implement your network
application elegantly without compromising
productivity. - MINA can be a complete network application
development management platform if we get our
effort together.
28Resources
- Homepage
- http//directory.apache.org/subprojects/network/
- Mailing List
- dev_at_directory.apache.org(Please use mina
prefix)
29Thank You!