服务端序列图
[img]http://dl2.iteye.com/upload/attachment/0086/0315/795d90db-d9b5-3c39-8d44-d3e892f6dafd.png[/img]
客户端序列图
[img]http://dl2.iteye.com/upload/attachment/0086/0317/a1e6eeed-333e-35fa-aef1-a9045b1a911a.png[/img]
客户端与服务端交互
[img]http://dl2.iteye.com/upload/attachment/0086/1049/439069d2-057f-3293-a885-7595fce16a01.png[/img]
transport:责任链模式,
ResponseCorrelator:oneway设置消息的编号,onCommand:对阻塞的futureResponse设置值,解除等待结果的线程阻塞。
MutexTransport:通过锁进行线程同步
WireFormatNegotiator:通过闭锁协调wireFormat与服务端的交互
InactivityMonitor:启动readcheck writecheck定时任务,维护心跳
TcpTransport tcp协议的业务处理,写入流,输出流
ActiveMQConnection:
负责处理客户端接受到的command
TransportConnection
负责处理服务端接受到的command
[img]http://dl2.iteye.com/upload/attachment/0086/0315/795d90db-d9b5-3c39-8d44-d3e892f6dafd.png[/img]
客户端序列图
[img]http://dl2.iteye.com/upload/attachment/0086/0317/a1e6eeed-333e-35fa-aef1-a9045b1a911a.png[/img]
客户端与服务端交互
[img]http://dl2.iteye.com/upload/attachment/0086/1049/439069d2-057f-3293-a885-7595fce16a01.png[/img]
transport:责任链模式,
ResponseCorrelator:oneway设置消息的编号,onCommand:对阻塞的futureResponse设置值,解除等待结果的线程阻塞。
MutexTransport:通过锁进行线程同步
WireFormatNegotiator:通过闭锁协调wireFormat与服务端的交互
InactivityMonitor:启动readcheck writecheck定时任务,维护心跳
TcpTransport tcp协议的业务处理,写入流,输出流
ActiveMQConnection:
负责处理客户端接受到的command
TransportConnection
负责处理服务端接受到的command
本文详细解析了服务端与客户端的交互流程,包括责任链模式的应用、消息编号的设置、线程同步的方法以及心跳维护的实现等关键技术点。

被折叠的 条评论
为什么被折叠?



