网络容器UML图
2024-06-01 11:29:10 0 举报
简易版本的服务容器设计图
作者其他创作
大纲/内容
InvokerProxy
+ appConfig+ urlHandlerMapping+ filterChain
一对多
WorkerPool
+ localThreadPool+ appConfig
依赖/提交业务线程
UrlHandlerMapping
MethodHandler
+ target: instance+ method: Method+ arguments: []
ClassNameHandler
依赖
StaticFilter
+ 在线人数+ qps- 超时请求数+ 成功请求数+ 总请求数
ContextI
+ getProto() : ProtocolI+ getServer() : ServerI+ getAppService(): AppService
HandlerI
Header
+ url: string (TLV)+ uuid: (128bit唯一编码)- attributes:Map
// set get 方法
MonitorFilter
+ status+ lastServicetime
AppConfig
- serverType: String- host: String- port: int- protoType: int- workerThreads: int- workerQueueSize: int- disconnnectOnChannelFull: bool
// set and get 方法
ProtocolI
+ encode(Message message) :byte[]+ decode(byte[]) :Message
调用
TCPContext
T1Protocol
FilterChain
+ filter
+ entryFilter()+ existFilter()
TCPServer
+ start()+ stop+ enable()
Request
+ head: Header+ transporter: Transporter + body: byte[]+ params: Map
+ <T> convertBody(): T + validate()+ statue()
Filter
+ next: Filter
TCPTransport
+ context: ContextI
XmlParse
+ parseXml(location: String): AppConfig
1. 动态代理 2. 可以参考dubbo使用java assist 添加统一入口
HandlerMappingScanner
+ appConfig
+ doScan(String parentPath)
ServerI
Transporter
BlackWhilteFilter
Set<Host> blackList
AppService
- appConfig: AppConfig- urlHandlerMapping: UrlHandlerMapping- context: List<ContextI>
+ init()+ start()+ close()
Response
+ head: Header+ transporter: Transporter+ T body
+ convertBody() : byte[]+ isSucess(): bool+ getResponseBody(): T
0 条评论
下一页