Abstract - Components
From the server side's point of view, there are eight
popular Apache MINA components you need to master before
you program the application. They are:
- 1. Buffer
- 2. Acceptor
- 3. Config
- 4. Filter
- 5. Codec
- 6. Handler
- 7. Session
- 8. Message
1. Buffer
Buffer is a concept from Java NIO. Please refer to
http://java.sun.com/j2se/1.5.0/d ... ml?is-external=true
for more information. To simplify, Buffer is a container which represents
the content of the communication.
Relative class/interface:
- org.apache.mina.common.ByteBuffer
- org.apache.mina.common.ByteBufferAllocator
- org.apache.mina.common.SimpleByteBufferAllocator
- org.apache.mina.common.PooledByteBufferAllocator
- org.apache.mina.common.ByteBufferProxy
- org.apache.mina.util.ByteBufferUtil
2. Acceptor
Acceptor is a server side concept, which accepts incoming connection,
communications with clients, and fires events to Handlers.
If you're an experienced network programmer, you must have know the
binding, listening and accepting concepts. If you only program with
Java ServerSocket before, you may miss the listening part.
However, ServerSocket combines all the network operation within one
class, while Apache MINA extracts binding, listening and accepting
operations into Acceptors.
IoAcceptor is the interface for Acceptors. The implementations of this interface
includes:
- org.apache.mina.common.support.BaseIoAcceptor
- org.apache.mina.transport.socket.nio.DatagramAcceptor
- org.apache.mina.common.support.DelegatedIoAcceptor
- org.apache.mina.transport.socket.nio.SocketAcceptor
- org.apache.mina.transport.vmpipe.VmPipeAcceptor
Note that: IoAcceptor is a sub interface of IoService, and another
sub interface of IoService is IoConnection. Please refer to Abstract - layers
for more information about IoService Layer concept.
[ 本帖最后由 key 于 22-10-2009 12:25 编辑 ] |