1,替换jar包:1.1.7中ssl是单独的一个jar包,在2.x.x中已经被集成到core包中了。

2,修改的类
org.apache.mina.common.IoHandlerAdapter -> org.apache.mina.core.service.IoHandlerAdapter
org.apache.mina.common.IoConnector -> org.apache.mina.core.service.IoConnector
rg.apache.mina.common.ConnectFuture -> org.apache.mina.core.future.ConnectFuture
org.apache.mina.common.IoSession -> org.apache.mina.core.session.IoSession
org.apache.mina.common.IoServiceConfig -> org.apache.mina.core.session.IoSessionConfig
org.apache.mina.common.WriteFuture -> org.apache.mina.core.future.WriteFuture
org.apache.mina.common.IoSessionConfig -> org.apache.mina.core.session.IoSessionConfig
org.apache.mina.transport.socket.nio.SocketSessionConfig -> org.apache.mina.transport.socket.SocketSessionConfig
org.apache.mina.common.DefaultIoFilterChainBuilder -> org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder
org.apache.mina.common.IoFilterChain -> org.apache.mina.core.filterchain.IoFilterChain
org.apache.mina.common.IoFilterChainBuilder -> org.apache.mina.core.filterchain.IoFilterChainBuilder
org.apache.mina.filter.SSLFilter -> org.apache.mina.filter.ssl.SslFilter
org.apache.mina.transport.socket.nio.SocketAcceptorConfig
 
3,修改的方法
IoServiceConfig.setFilterChainBuilder -> IoAcceptor.setFilterChainBuilder
IoConnector.connect参数中的handler放到了sethandler中,IoAcceptor中的参数同理
IoSession.ioSession.getScheduledWriteBytes() -> ioSession.getScheduledWriteMessages()
MessageDecoder中各接口参数中的ByteBuffer改为IoBuffer
ProtocolDecoderOutput.flush() -> ProtocolDecoderOutput.flush(NextFilter nextFilter, IoSession session)
4,2.x中删掉的类
org.apache.mina.common.ByteBuffer
org.apache.mina.common.SimpleByteBufferAllocator
org.apache.mina.common.ThreadModel
org.apache.mina.common.TransportType
 
IoAcceptor.isManaged
 
5,编解码器工厂的构造变了,不用super.register(Class)了,用super.addMessageDecoder(Class)和super.addMessageEncoder(Iterable, Class),addMessageEncoder的第一个参数是一个编码变量的集合