Broker模式类图
2017-03-12 19:35:51 0 举报
Broker模式是一种消息传递模式,它通过一个中介者对象来处理消息的发送和接收。在类图中,我们可以看到有三个主要的对象:发送者、接收者和中介者。发送者负责创建消息并将其发送给中介者,接收者从中介者那里获取消息。中介者负责维护所有发送者和接收者的关系,并确保消息能够正确地传递给接收者。这种模式可以有效地解耦发送者和接收者之间的依赖关系,使得系统更加灵活和可扩展。
作者其他创作
大纲/内容
key:
《interface》SecurityIntercepter
- preHandle()- postHandle()- afterCompletion()
关联
实现
HeartbeatController
Map brokerState
fault()
RequestSpecification
mapList: MapuserRequestList:userBrokerRequestListscheduleRequestList:scheduleBrokerRequestListchecker:HearbeatCheck
specifiyRequest(request)dispatchRequest(request)
DenyRecord
- denyList
- recordDeny()- handleDeny()
HeartbeatCheck
maxTimeInterval:int
cancelWarning()
n
1
client
requestDispatcher
UserBroker
+ BrokerList
- locateBroker()- locateClient()- registerBroker()- unregisterBroker()
Schedule1Cache
+Server
- getData
brokerMapping.xml定义请求和broker之间的对应关系
userBrokerRequestList
requestList:Listchecker:HearbeatCheck
addNewRequest(request)forwardRequest(request)
OrderMapping.xml定义OrderBroker和server之间的对应关系
ServerSafety
- requestList
- encyptData()- identityData()- controllResourceReq()
FaultMonitor
Log faultLog
-handle()
BrokerInterface
-respond
TimeCheck
Map processTime
-check()
TimeoutMonitor
Log timeoutLog
-reSchedule()
ScheduleServiceImpl
checker:HeartbeatChecker
searchRestTicket()getScheduleTimeTable()getRailways()
brokerMapping.xml定义broker和cache之间的对应关系
UserTicketServiceImpl
checker:HeartbeatCheckerlocator:ServiceLocatorencryptioner:DataEncryption
buyTicket()searchUnGoneOrder()TicketChange()TicketReturn()Login()LookAtMyOrder()
UserAuthority
- validateUser- authorizeUser- forbidUser
ScheduleService
依赖
UserTicketService
IBroker
-receive()-send()
聚合
TicketBroker
- locateBroker- locateServer- registerServer- registerBroker
RequestSpecificationService
ServiceLocater
findService(serviceName)
Bridge
- packData()- unpackData()- forwardMessage()
RequestDetection
- recordRequest()- filterRequest()- handleResponse()
AccountMapping.xml定义AccountBroker和server之间的对应关系
ScheduleBroker
+ ServerList
- locateServer()- locateClient()- registerServer()- unregisterServer()
DataEncryption
encryptData(data)
HeartbeatChecker
IntervalCheck
Map accetableSilence
OrderBroker
TicketMapping.xml定义TicketBroker和server之间的对应关系
VisitAuthorityChecker
checker:HeartbeatCheckeruserPart:UserTicketServiceImplschedulePart:ScheduleServiceImpl
findPresentUser()locateUserRange(user)
ProcessTimmer
-receive()-timeout()
...
SchedulenCache
AccountBroker
scheduleBrokerRequestList
0 条评论
下一页