-
Notifications
You must be signed in to change notification settings - Fork 1
/
spring-webflux.drawio
1607 lines (1607 loc) · 287 KB
/
spring-webflux.drawio
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<mxfile host="Electron" modified="2024-04-26T09:43:33.816Z" agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/21.6.5 Chrome/114.0.5735.243 Electron/25.3.1 Safari/537.36" etag="lUy8VWE-L6UXMHpasgWi" version="21.6.5" type="device">
<diagram name="第 1 页" id="0NwcDRs000kfrG-1apiR">
<mxGraphModel dx="3847" dy="837" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="QhXQWBFm0-bGqjXrz0u2-1" value="<p style="line-height: 1"></p><h1><font style="font-size: 20px">Spring-WebFlux 工作原理</font><font style="font-size: 16px">&nbsp;</font><font style="font-size: 10px">(v5.2.1)&nbsp;<br style="font-size: 10px"></font></h1><div style="font-size: 10px">属于spring-framework的一个模块。对比Spring MVC实现原理看,两者实现还是类似的。这里基于 spring-boot-starter-webflux:2.2.1.RELEASE分析。</div><p style="font-size: 10px"><font style="font-size: 10px">前提:</font></p><p style="font-size: 10px"></p><ul style="font-size: 10px"><li style="font-size: 10px">SpringBoot 初始化流程(主要是Web容器初始化原理,可以参考 spring-analysis中的流程图)</li><li style="font-size: 10px">Reactor3、Reator-Netty(将Netty封装成了响应式的通信框架)、Netty工作原理(参考Netty源码分析流程图)、Netty应用开发(WebFlux默认使用Netty作为Web容器)</li></ul><div>说明:<br><ul><li>将WebFlux使用Reactor-Netty实现HTTP响应式服务器的主流程代码抽离到了reactor-netty/webflux-skeleton模块(省略了DispatcherHandler复杂的处理),可以用来理解Reactor-Netty对Netty的封装原理以及HTTP协议处理原理</li><li>决定还是将Reactor-Netty逻辑画到一个新的流程图,不然这里的流程图看起来有点过于复杂了</li></ul></div><p style="font-size: 10px"></p><p></p>" style="text;html=1;strokeColor=none;fillColor=none;spacing=5;spacingTop=-20;whiteSpace=wrap;overflow=hidden;rounded=0;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="10" y="10" width="810" height="180" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-41" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-36" target="QhXQWBFm0-bGqjXrz0u2-40" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-36" value="spring-boot-starter-webflux" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" vertex="1">
<mxGeometry x="40" y="200" width="160" height="60" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-94" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-40" target="QhXQWBFm0-bGqjXrz0u2-93" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-252" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-40" target="QhXQWBFm0-bGqjXrz0u2-42" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-40" value="<font style="font-size: 10px;">自动配置<br><font color="#007fff">扫描配置类加载BeanDefinition时加载</font><br></font>" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="240" y="200" width="160" height="60" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-99" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-42" target="QhXQWBFm0-bGqjXrz0u2-98" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-42" value="<font style="font-size: 10px;">初始化流程<br><font style="font-size: 10px;" color="#007fff">需要了解SpringBoot初始化流程<br>这里只关注WebFlux初始化流程<br></font></font>" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="240" y="599" width="160" height="60" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-18" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-43" target="ALvgZmMKo5qc2uUOR07o-17" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-43" value="请求处理与响应" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" vertex="1">
<mxGeometry x="40" y="1840" width="160" height="60" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-96" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-93" target="QhXQWBFm0-bGqjXrz0u2-95" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-240" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-93" target="QhXQWBFm0-bGqjXrz0u2-238" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-93" value="<font style="font-size: 10px;">spring-boot-starter-<br>reactor-netty<br><font style="font-size: 10px;" color="#007fff">核心是这个starter,不过它本身并没有自动配置类,只是引入依赖</font></font>" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="440" y="200" width="160" height="60" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-239" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-95" target="QhXQWBFm0-bGqjXrz0u2-238" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-245" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-95" target="QhXQWBFm0-bGqjXrz0u2-242" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-95" value="<font style="font-size: 10px;">spring-boot-autoconfigure<br></font>" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="640" y="200" width="160" height="60" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-101" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-98" target="QhXQWBFm0-bGqjXrz0u2-100" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-98" value="<font style="font-size: 10px;"><font style="font-size: 10px;">SpringApplication#run(...)<br></font></font>" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="439" y="599" width="160" height="60" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-103" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-100" target="QhXQWBFm0-bGqjXrz0u2-102" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-107" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-100" target="QhXQWBFm0-bGqjXrz0u2-106" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-100" value="<font style="font-size: 10px;">new SpringApplication(primarySources))<br><font color="#007fff">选择Web类型</font><br></font>" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="639" y="599" width="160" height="60" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-102" value="this.webApplicationType = WebApplicationType<br>.deduceFromClasspath();<br><font color="#007fff">通过尝试加载类判断Web应用类型,是REACTIVE还是SERVLET</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fillColor=#fff2cc;strokeColor=#d6b656;" parent="1" vertex="1">
<mxGeometry x="839" y="599" width="201" height="60" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-110" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-106" target="QhXQWBFm0-bGqjXrz0u2-109" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-106" value="run(args)" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="639" y="679" width="160" height="60" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-108" value="<font style="font-size: 10px;" color="#007fff">可以加载org.springframework.web.reactive.<b>DispatcherHandler </b>(spring-webflux中定义的类,前面引入了此依赖,一定是会加载的)<br>且不可以加载org.springframework.web.servlet.DispatcherServlet (spring-mvc中定义的类,没有引入此依赖,一定不可以加载此类,下同)<br>和&nbsp;org.glassfish.jersey.servlet.ServletContainer 说明是 REACTIVE 类型<br><b>这里的逻辑同时也说明应用要么是REACTIVE要么是SERLVET, 如果同时引入spring-webflux 和 spring-mvc 那也只是SERVLET类型。</b><br></font>" style="text;html=1;align=left;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1">
<mxGeometry x="1049" y="594" width="640" height="70" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-112" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-109" target="QhXQWBFm0-bGqjXrz0u2-111" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-115" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-109" target="QhXQWBFm0-bGqjXrz0u2-114" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-109" value="context = createApplicationContext();<br><font color="#007fff">实例化应用上下文</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="839" y="679" width="201" height="60" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-111" value="通过反射加载并实例化<br><b>AnnotationConfigReactiveWebServerApplicationContext</b>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fillColor=#fff2cc;strokeColor=#d6b656;" parent="1" vertex="1">
<mxGeometry x="1080.5" y="679" width="280" height="60" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-113" value="<font style="font-size: 10px;"><font color="#007fff">走到这里不妨先猜下接下来要初始化的内容(根据对MVC、Netty的了解,<br>个人认为主要包括下面3个流程):<br>1. 创建Netty服务端(采用HTTP11/HTTP2编解码器)<br>2. 解析@Controller注解的Bean 或 实现了RouterFunction接口的Bean,<br>然后添加修饰的拦截器、序列化反序列化等工具组成责任链然后注册到<br>DispatcherHandler Map中<br>3. 注册使用reator-netty封装的DispatcherHandler 为 ChannelHander,<br>注册到Netty服务端的pipeline中。</font><br></font>" style="text;html=1;align=left;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1">
<mxGeometry x="289" y="679" width="350" height="130" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-117" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-114" target="QhXQWBFm0-bGqjXrz0u2-116" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-114" value="refreshContext(context);" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="839" y="779" width="201" height="60" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-120" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-116" target="QhXQWBFm0-bGqjXrz0u2-119" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="u_z_PSljN5TfgaHLhyht-6" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-116" target="u_z_PSljN5TfgaHLhyht-5" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-116" value="refresh()" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="1081" y="779" width="160" height="60" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-118" value="<font style="font-size: 10px;">AbstractApplicationContext</font>" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1">
<mxGeometry x="1090.5" y="750" width="140" height="30" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-223" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-119" target="QhXQWBFm0-bGqjXrz0u2-121" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-256" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-119" target="QhXQWBFm0-bGqjXrz0u2-215" edge="1">
<mxGeometry relative="1" as="geometry">
<mxPoint x="1360.5" y="1001" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-119" value="onRefresh();" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="1280.5" y="779" width="160" height="60" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-125" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-121" target="QhXQWBFm0-bGqjXrz0u2-124" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-121" value="super.onRefresh();<br>this.<b>createWebServer</b>()" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="1479.5" y="779" width="160" height="60" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-123" value="<font style="font-size: 10px;">ReactiveWebServerApplicationContext</font>" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1">
<mxGeometry x="1459.5" y="749" width="200" height="30" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-127" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-124" target="QhXQWBFm0-bGqjXrz0u2-126" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-124" value="ReactiveWebServerFactory webServerFactory = this.getWebServerFactory(webServerFactoryBeanName);<br><font color="#007fff">加载ReactiveWebServerFactory类型工厂Bean,默认只有<br><b>NettyReactiveWebSeverFactory</b><br></font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="1679.5" y="779" width="280" height="60" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-133" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-126" target="QhXQWBFm0-bGqjXrz0u2-132" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-126" value="this.<b>serverManager</b> = ReactiveWebServerApplicationContext<br>.ServerManager.get(webServerFactory, lazyInit);" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="1679.5" y="859" width="280" height="60" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-128" value="<div style="text-align: center; font-size: 10px;"><font style="font-size: 10px;"><font style="font-size: 10px;" color="#330000">org.springframework.boot.web.server.</font><b style="color: rgb(51, 0, 0); background-color: initial;">AbstractConfigurableWebServerFactory</b></font></div><hr style="font-size: 10px;" size="1"><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;" color="#330000">private int <b>port</b> = 8080;</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;" color="#330000">private InetAddress <b>address</b>;</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;" color="#330000">private Set&lt;ErrorPage&gt; errorPages = new LinkedHashSet();</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;" color="#330000">private Ssl ssl;</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;" color="#330000">private SslStoreProvider sslStoreProvider;</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;" color="#330000">private Http2 <b>http2</b>;</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;" color="#330000">private Compression compression;</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;" color="#330000">private String serverHeader;</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><br></p>" style="verticalAlign=top;align=left;overflow=fill;fontSize=12;fontFamily=Helvetica;html=1;fontColor=#007FFF;" parent="1" vertex="1">
<mxGeometry x="-440" y="480" width="400" height="160" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-130" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;endArrow=blockThin;endFill=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-129" target="QhXQWBFm0-bGqjXrz0u2-128" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-129" value="<div style="text-align: center; font-size: 10px;"><font style="font-size: 10px;"><font style="font-size: 10px;" color="#330000">org.springframework.boot.web.embedded.netty.</font><span style="color: rgb(51, 0, 0); background-color: initial;"><b>NettyReactiveWebServerFactory</b></span></font></div><hr style="font-size: 10px;" size="1"><p style="margin: 0px 0px 0px 4px; font-size: 10px;">创建基于Netty的响应式 WebServer 工厂</p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;" color="#330000"><br></font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;" color="#330000">private Set&lt;NettyServerCustomizer&gt; <b>serverCustomizers</b> = new LinkedHashSet();</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;" color="#330000">private List&lt;NettyRouteProvider&gt; <b>routeProviders</b> = new ArrayList();</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;" color="#330000">private Duration <b>lifecycleTimeout</b>;</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;" color="#330000">private boolean useForwardHeaders;</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;" color="#330000">private ReactorResourceFactory resourceFactory;</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><br></p>" style="verticalAlign=top;align=left;overflow=fill;fontSize=12;fontFamily=Helvetica;html=1;fontColor=#007FFF;" parent="1" vertex="1">
<mxGeometry x="-440" y="680" width="400" height="120" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-131" value="<div style="text-align: center; font-size: 11px;"><font style="font-size: 11px;"><font style="font-size: 11px;" color="#330000">org.springframework.boot.web.reactive.context.</font><font style="background-color: initial; font-size: 11px;" color="#330000">ReactiveWebServerApplicationContext.</font><b style="background-color: initial; color: rgb(51, 0, 0);">ServerManager</b></font></div><hr style="font-size: 11px;" size="1"><p style="margin: 0px 0px 0px 4px; font-size: 11px;"><font style="font-size: 11px;" color="#330000"></font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 11px;">响应式WebServer实例的</font><font style="font-size: 10px;">缓存容器,&nbsp;class ServerManager implements HttpHandler</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;">是&nbsp;<b>ReactiveWebServerApplicationContext&nbsp;</b>的成员变量</p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;"><br></font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;">//经过多层装饰后的Netty服务器</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;" color="#330000">private final <b>WebServer</b> <b>server</b>;</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;">//是否是首次请求才初始化HttpHandler</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;" color="#330000">private final boolean lazyInit;</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;">//即HttpWebHandlerAdpater实例</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;" color="#330000">private volatile HttpHandler <b>handler</b> = this::handleUninitialized;</font></p>" style="verticalAlign=top;align=left;overflow=fill;fontSize=12;fontFamily=Helvetica;html=1;fontColor=#007FFF;" parent="1" vertex="1">
<mxGeometry x="-1000" y="480" width="520" height="160" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-135" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-132" target="QhXQWBFm0-bGqjXrz0u2-134" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-132" value="new ServerManager(factory, lazyInit);" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="1999.5" y="859" width="160" height="60" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-139" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-134" target="QhXQWBFm0-bGqjXrz0u2-138" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-134" value="this.server = factory.<b>getWebServer</b>(this);" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="2199.5" y="859" width="160" height="60" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-141" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-138" target="QhXQWBFm0-bGqjXrz0u2-140" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-148" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-138" target="QhXQWBFm0-bGqjXrz0u2-147" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-138" value="<div>HttpServer <b>httpServer</b> = this.<b>createHttpServer</b>();</div><div><font color="#007fff">创建Netty服务端并设置默认配置</font></div>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fillColor=#fff2cc;strokeColor=#d6b656;" parent="1" vertex="1">
<mxGeometry x="2399.5" y="859" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-143" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-140" target="QhXQWBFm0-bGqjXrz0u2-142" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="IVSfiaFSnUMNmgRAi2Nb-5" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.407;entryDx=0;entryDy=0;entryPerimeter=0;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-140" target="IVSfiaFSnUMNmgRAi2Nb-4" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-140" value="<div><font style="font-size: 9px;">ReactorHttpHandlerAdapter handlerAdapter = new ReactorHttpHandlerAdapter(httpHandler);</font><br></div><div><font color="#007fff" style="font-size: 9px;">这里只是个空壳,后面</font></div><font size="1" color="#007fff">finishRefresh()中</font><span style="font-size: 9px; color: rgb(0, 127, 255); background-color: initial;">才初始化</span><font size="1" color="#007fff"><br></font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fillColor=#fff2cc;strokeColor=#d6b656;" parent="1" vertex="1">
<mxGeometry x="2399.5" y="979" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-213" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-142" target="QhXQWBFm0-bGqjXrz0u2-144" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-142" value="<div><font style="font-size: 10px;">NettyWebServer webServer = this.<b>createNettyWebServer</b>(<b>httpServer</b>, <b>handlerAdapter</b>, this.lifecycleTimeout, this.getShutdown());</font><br></div>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fillColor=#e3c800;strokeColor=#B09500;fontColor=#000000;" parent="1" vertex="1">
<mxGeometry x="2399.5" y="1059" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="IVSfiaFSnUMNmgRAi2Nb-6" style="rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=0.998;entryY=0.487;entryDx=0;entryDy=0;entryPerimeter=0;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-144" target="IVSfiaFSnUMNmgRAi2Nb-4" edge="1">
<mxGeometry relative="1" as="geometry">
<mxPoint x="2360" y="1020" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-144" value="<div>webServer.setRouteProviders(<br>this.routeProviders);<br></div><div><font color="#007fff">这个routeProviders是空的</font></div>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fillColor=#fff2cc;strokeColor=#d6b656;" parent="1" vertex="1">
<mxGeometry x="2399.5" y="1139" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-153" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-147" target="QhXQWBFm0-bGqjXrz0u2-152" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-173" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="ALvgZmMKo5qc2uUOR07o-60" target="QhXQWBFm0-bGqjXrz0u2-172" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-147" value="<b>HttpServer</b> <b>server</b> = HttpServer.create();<br><font color="#007fff"><b>HttpServerBind</b> 单例对象,默认本质是Netty服务端</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="2639.5" y="859" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-149" value="<div style="text-align: center; font-size: 11px;"><font style="font-size: 11px;"><font style="font-size: 11px;" color="#000000">reactor.netty.http.server<font style="background-color: initial; font-size: 11px;">.</font></font><b style="color: rgb(0, 0, 0); background-color: initial;">HttpServer</b></font></div><hr style="font-size: 11px;" size="1"><p style="margin: 0px 0px 0px 4px; font-size: 11px;"><font style="font-size: 11px;">reator-netty HTTP服务器实现类</font></p><p style="margin: 0px 0px 0px 4px; font-size: 11px;"><font style="font-size: 11px;" color="#000000"><br></font></p><p style="margin: 0px 0px 0px 4px; font-size: 11px;"><font style="font-size: 11px;" color="#000000">static final TcpServer <b>DEFAULT_TCP_SERVER</b> = TcpServer.create();</font></p><p style="margin: 0px 0px 0px 4px; font-size: 11px;"><span style="color: rgb(0, 0, 0); background-color: initial;">static final Function&lt;TcpServer, TcpServer&gt; </span><b style="color: rgb(0, 0, 0); background-color: initial;">COMPRESS_ATTR_CONFIG</b><span style="color: rgb(0, 0, 0); background-color: initial;"> = (tcp) -&gt; {</span><br></p><p style="margin: 0px 0px 0px 4px; font-size: 11px;"><font style="font-size: 11px;" color="#000000">&nbsp; &nbsp; return tcp.bootstrap(HttpServerConfiguration.MAP_COMPRESS);</font></p><p style="margin: 0px 0px 0px 4px; font-size: 11px;"><font style="font-size: 11px;" color="#000000">};</font></p><p style="margin: 0px 0px 0px 4px; font-size: 11px;"><font style="font-size: 11px;" color="#000000">static final Function&lt;TcpServer, TcpServer&gt; <b>COMPRESS_ATTR_DISABLE</b> = (tcp) -&gt; {</font></p><p style="margin: 0px 0px 0px 4px; font-size: 11px;"><font style="font-size: 11px;" color="#000000">&nbsp; &nbsp; return tcp.bootstrap(HttpServerConfiguration.MAP_NO_COMPRESS);</font></p><p style="margin: 0px 0px 0px 4px; font-size: 11px;"><font style="font-size: 11px;" color="#000000">};</font></p><p style="margin: 0px 0px 0px 4px; font-size: 11px;"><font style="font-size: 11px;" color="#000000">static final Function&lt;TcpServer, TcpServer&gt; <b>FORWARD_ATTR_CONFIG</b> = (tcp) -&gt; {</font></p><p style="margin: 0px 0px 0px 4px; font-size: 11px;"><font style="font-size: 11px;" color="#000000">&nbsp; &nbsp; return tcp.bootstrap(HttpServerConfiguration.MAP_FORWARDED);</font></p><p style="margin: 0px 0px 0px 4px; font-size: 11px;"><font style="font-size: 11px;" color="#000000">};</font></p><p style="margin: 0px 0px 0px 4px; font-size: 11px;"><font style="font-size: 11px;" color="#000000">static final Function&lt;TcpServer, TcpServer&gt; <b>FORWARD_ATTR_DISABLE</b> = (tcp) -&gt; {</font></p><p style="margin: 0px 0px 0px 4px; font-size: 11px;"><font style="font-size: 11px;" color="#000000">&nbsp; &nbsp; return tcp.bootstrap(HttpServerConfiguration.MAP_NO_FORWARDED);</font></p><p style="margin: 0px 0px 0px 4px; font-size: 11px;"><font style="font-size: 11px;" color="#000000">};</font></p>" style="verticalAlign=top;align=left;overflow=fill;fontSize=12;fontFamily=Helvetica;html=1;fontColor=#007FFF;" parent="1" vertex="1">
<mxGeometry x="-960" y="840" width="480" height="260" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-151" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;endArrow=block;endFill=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-150" target="QhXQWBFm0-bGqjXrz0u2-149" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-150" value="<div style="text-align: center; font-size: 11px;"><font style="font-size: 11px;" color="#000000">reactor.netty.http.server<font style="background-color: initial; font-size: 11px;">.</font><b style="background-color: initial;"><font style="font-size: 11px;">HttpServerBind</font></b></font></div><hr style="font-size: 11px;" size="1"><p style="margin: 0px 0px 0px 4px; font-size: 11px;"><font style="font-size: 11px;">基于 Netty 响应式 WebServer 的默认实现,本质就是 TcpServerBind.INSTANCE</font></p><p style="margin: 0px 0px 0px 4px; font-size: 11px;"><font style="font-size: 11px;"><br></font></p><p style="margin: 0px 0px 0px 4px; font-size: 11px;"><font style="font-size: 11px;" color="#000000">static final HttpServerBind <b>INSTANCE</b> = new HttpServerBind();</font></p><p style="margin: 0px 0px 0px 4px; font-size: 11px;"><font style="font-size: 11px;" color="#000000">static final Function&lt;DisposableServer, DisposableServer&gt; <b>CLEANUP_GLOBAL_RESOURCE</b> =&nbsp;</font></p><p style="margin: 0px 0px 0px 4px; font-size: 11px;"><font style="font-size: 11px;" color="#000000"><span style="white-space: pre;">	</span>DisposableBind::new;</font></p><p style="margin: 0px 0px 0px 4px; font-size: 11px;"><font style="font-size: 11px;" color="#000000">final TcpServer <b>tcpServer</b>;</font></p>" style="verticalAlign=top;align=left;overflow=fill;fontSize=12;fontFamily=Helvetica;html=1;fontColor=#007FFF;" parent="1" vertex="1">
<mxGeometry x="-960" y="1134" width="480" height="106" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-159" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-152" target="QhXQWBFm0-bGqjXrz0u2-158" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-152" value="TcpServer <b>DEFAULT_TCP_SERVER</b> = TcpServer.create();<br><font color="#007fff">TcpServerBind 单例对象</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="2879.5" y="859" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-157" style="rounded=1;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;endArrow=diamondThin;endFill=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-154" target="QhXQWBFm0-bGqjXrz0u2-150" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-154" value="<div style="text-align: center; font-size: 11px;"><font style="font-size: 11px;"><font style="font-size: 11px;" color="#000000">reactor.netty.tcp.</font><span style="color: rgb(0, 0, 0); background-color: initial;"><b>TcpServer</b></span></font></div><hr style="font-size: 11px;" size="1"><p style="margin: 0px 0px 0px 4px; font-size: 11px;"><font style="font-size: 11px;" color="#000000"><br></font></p><p style="margin: 0px 0px 0px 4px;"><font color="#000000">static final int <b>DEFAULT_PORT</b> = 0;</font><br></p>" style="verticalAlign=top;align=left;overflow=fill;fontSize=12;fontFamily=Helvetica;html=1;fontColor=#007FFF;" parent="1" vertex="1">
<mxGeometry x="-1400" y="1020" width="400" height="80" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-155" style="rounded=1;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;endArrow=block;endFill=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-156" target="QhXQWBFm0-bGqjXrz0u2-154" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-156" value="<div style="text-align: center;"><font color="#000000">reactor.netty.tcp.<b>Tcp</b></font><b style="font-size: 11px; color: rgb(0, 0, 0); background-color: initial;">ServerBind</b></div><hr style="font-size: 11px;" size="1"><p style="margin: 0px 0px 0px 4px; font-size: 11px;"><font style="font-size: 11px;">基于 Netty 响应式 WebServer 的默认实现,本质就是 TcpServerBind.INSTANCE</font></p><p style="margin: 0px 0px 0px 4px; font-size: 11px;">同时实现了 Function&lt;ServerBootStrap, ServerBootstrap&gt; 接口,用于定义初始化<br>方法</p><p style="margin: 0px 0px 0px 4px; font-size: 11px;"><font style="font-size: 11px;"><br></font></p><p style="margin: 0px 0px 0px 4px;"><font color="#000000">static final TcpServerBind <b>INSTANCE</b> = new TcpServerBind();</font></p><p style="margin: 0px 0px 0px 4px;">//Netty最基础的服务端实例</p><p style="margin: 0px 0px 0px 4px;"><font color="#000000"><span style="font-size: 11px;">final <b>ServerBootstrap</b> <b>serverBootstrap</b> = this.createServerBootstrap();</span></font></p>" style="verticalAlign=top;align=left;overflow=fill;fontSize=12;fontFamily=Helvetica;html=1;fontColor=#007FFF;" parent="1" vertex="1">
<mxGeometry x="-1400" y="1134" width="400" height="126" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-158" value="<div>return (ServerBootstrap)((ServerBootstrap)(new <b>ServerBootstrap</b>())</div><div>&nbsp; &nbsp; .<b>option</b>(ChannelOption.SO_REUSEADDR, true))</div><div>&nbsp; &nbsp; .<b>childOption</b>(ChannelOption.AUTO_READ, false)</div><div>&nbsp; &nbsp; .<b>childOption</b>(ChannelOption.TCP_NODELAY, true)</div><div>&nbsp; &nbsp; .<b>localAddress</b>(new InetSocketAddress(0));</div><div><font color="#007fff">创建Netty服务端</font></div>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;align=left;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" vertex="1">
<mxGeometry x="3119.5" y="844" width="320" height="90" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-56" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;dashed=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-160" target="ALvgZmMKo5qc2uUOR07o-55" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-160" value="<div style="font-size: 9px;"><font style="font-size: 9px;">server = server.<b>tcpConfiguration</b>((tcpServer) -&gt; {</font></div><div style="font-size: 9px;"><font style="font-size: 9px;">&nbsp; &nbsp; return tcpServer.runOn(resources)</font></div><div style="font-size: 9px;"><font style="font-size: 9px;">.addressSupplier(this::getListenAddress);</font></div><div style="font-size: 9px;"><font style="font-size: 9px;">});</font></div>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;align=left;" parent="1" vertex="1">
<mxGeometry x="2879.5" y="979" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-76" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-162" target="ALvgZmMKo5qc2uUOR07o-75" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-162" value="<div style=""><font size="1">b.group(selectorGroup, elg)</font></div><div style=""><font size="1">.<b>channel</b>(resources.onServerChannel(elg));<br></font><font color="#007fff">设置Channel类型(即服务端连接的实现), 默认使用native实现,还可以选择</font></div><font color="#007fff"><b>NioServerSocketChannel</b></font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;align=left;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" vertex="1">
<mxGeometry x="3120" y="1139" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-167" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;dashed=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-164" target="QhXQWBFm0-bGqjXrz0u2-166" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-164" value="<div style="font-size: 9px;"><div>server = server.tcpConfiguration((tcpServer) -&gt; {</div><div>&nbsp; &nbsp; return tcpServer.runOn(resources)<br>.addressSupplier(this::getListenAddress);</div><div>});</div></div>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;align=left;" parent="1" vertex="1">
<mxGeometry x="2879.5" y="1240" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-166" value="<div style="font-size: 9px;"><font style="font-size: 9px;">(ServerBootstrap)b.<b>localAddress</b>(<br>(SocketAddress)bindingAddressSupplier.get());</font><br></div><div style="font-size: 9px;"><font color="#007fff">绑定端口地址</font></div>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;align=left;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" vertex="1">
<mxGeometry x="3119.5" y="1240" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-171" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-168" target="QhXQWBFm0-bGqjXrz0u2-170" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-184" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-168" target="QhXQWBFm0-bGqjXrz0u2-183" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-168" value="<div style=""><font size="1">server = server.<b>protocol</b>(this.listProtocols())<br>.<b>forwarded</b>(this.useForwardHeaders);</font><br></div><div style=""><font color="#007fff" size="1">设置用于选择通信协议的初始化函数,如果有启用HTTP2就使用HTTP2协议否则用HTTP11</font></div>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;align=center;" parent="1" vertex="1">
<mxGeometry x="2640" y="1399" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-182" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-170" target="QhXQWBFm0-bGqjXrz0u2-181" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-170" value="<div style=""><font size="1">return this.<b>applyCustomizers</b>(server);</font><br></div><div style=""><font color="#007fff" size="1">默认只有一个解码器的配置</font></div>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;align=center;" parent="1" vertex="1">
<mxGeometry x="2640" y="1559" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-174" value="Y" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-172" target="QhXQWBFm0-bGqjXrz0u2-160" edge="1">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="2860" y="1169" />
<mxPoint x="2860" y="1009" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-176" value="N" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-172" target="QhXQWBFm0-bGqjXrz0u2-164" edge="1">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="2800" y="1170" />
<mxPoint x="2860" y="1170" />
<mxPoint x="2860" y="1270" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-179" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-172" target="QhXQWBFm0-bGqjXrz0u2-178" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-172" value="this.resourceFactory <br>!= null" style="rhombus;whiteSpace=wrap;html=1;fontSize=10;rounded=1;" parent="1" vertex="1">
<mxGeometry x="2679.5" y="1139" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-180" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-178" target="QhXQWBFm0-bGqjXrz0u2-168" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-178" value="<div style=""><font size="1">SSL、数据压缩等</font></div><div style=""><font color="#007fff" size="1">默认没启用略</font></div>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;align=center;" parent="1" vertex="1">
<mxGeometry x="2640" y="1319" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-207" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-181" target="QhXQWBFm0-bGqjXrz0u2-206" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-181" value="<div style="">for&nbsp;this.serverCustomizers:</div><div style="">server = customizer.<b>apply</b>(server);<br></div>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;align=center;" parent="1" vertex="1">
<mxGeometry x="2880" y="1559" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-203" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-183" target="QhXQWBFm0-bGqjXrz0u2-202" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-84" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;dashed=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-183" target="ALvgZmMKo5qc2uUOR07o-83" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-183" value="<div style="font-size: 8px;"><div><div>return this.<b>tcpConfiguration</b>((tcpServer) -&gt; {</div><div>&nbsp; &nbsp; return tcpServer.<b>bootstrap</b>((b) -&gt; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; return HttpServerConfiguration</div><div>.protocols(b, supportedProtocols);</div><div>&nbsp; &nbsp; });</div><div>});</div></div></div>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;align=left;" parent="1" vertex="1">
<mxGeometry x="2880" y="1399" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-186" style="rounded=1;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;strokeColor=none;endArrow=block;endFill=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-185" target="QhXQWBFm0-bGqjXrz0u2-154" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-187" style="rounded=1;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;endArrow=block;endFill=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-185" target="QhXQWBFm0-bGqjXrz0u2-154" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-185" value="<div style="text-align: center; font-size: 11px;"><font style="font-size: 11px;"><font style="font-size: 11px;"><font style="font-size: 11px;" color="#000000">reactor.netty.tcp.</font></font><span style="color: rgb(0, 0, 0); background-color: initial;"><b>TcpServerOperator</b></span></font></div><hr style="font-size: 11px;" size="1"><p style="margin: 0px 0px 0px 4px; font-size: 11px;"><font style="font-size: 11px;" color="#000000"><br></font></p><p style="margin: 0px 0px 0px 4px;"><font color="#000000">final TcpServer source;</font><br></p>" style="verticalAlign=top;align=left;overflow=fill;fontSize=12;fontFamily=Helvetica;html=1;fontColor=#007FFF;" parent="1" vertex="1">
<mxGeometry x="-1780" y="1134" width="320" height="105" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-189" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;endArrow=block;endFill=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-188" target="QhXQWBFm0-bGqjXrz0u2-185" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-188" value="<div style="text-align: center; font-size: 11px;"><font style="font-size: 11px;"><font style="font-size: 11px;"><font style="font-size: 11px;"><font style="font-size: 11px;" color="#000000">reactor.netty.tcp.</font></font></font><span style="background-color: initial;"><b style="color: rgb(0, 0, 0);">TcpServerBootstrap </b>(这里其实是<b>装饰器模式</b>)</span></font></div><hr style="font-size: 11px;" size="1"><p style="margin: 0px 0px 0px 4px; font-size: 11px;"><font style="font-size: 11px;">//用于更新服务器配置的函数式方法,每装饰一层注册一个方法</font></p><p style="margin: 0px 0px 0px 4px; font-size: 11px;"><font style="font-size: 11px;" color="#000000">final Function&lt;? super ServerBootstrap, ? extends ServerBootstrap&gt; bootstrapMapper;</font><br></p>" style="verticalAlign=top;align=left;overflow=fill;fontSize=12;fontFamily=Helvetica;html=1;fontColor=#007FFF;" parent="1" vertex="1">
<mxGeometry x="-1840" y="1281" width="440" height="79" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-191" value="<font color="#007fff" style="font-size: 10px;">后面的逻辑是使用<b>装饰器模式</b>,<br>为HttpServer附加一些初始化方法,<br>在服务器启动时调用实现Netty服务器初始化<br></font>" style="text;html=1;align=left;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1">
<mxGeometry x="2639.5" y="919" width="220" height="60" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-195" style="rounded=1;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;endArrow=block;endFill=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-192" edge="1">
<mxGeometry relative="1" as="geometry">
<mxPoint x="-720.0000000000005" y="1100" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-192" value="<div style="text-align: center;"><font color="#000000">reactor.netty.http.server.</font><span style="color: rgb(0, 0, 0); background-color: initial;"><b>HttpServerOperator</b></span></div><hr style="font-size: 11px;" size="1"><p style="margin: 0px 0px 0px 4px; font-size: 11px;"><font style="font-size: 11px;" color="#000000"><br></font></p><p style="margin: 0px 0px 0px 4px;"><font color="#000000">final HttpServer&nbsp;source;</font><br></p>" style="verticalAlign=top;align=left;overflow=fill;fontSize=12;fontFamily=Helvetica;html=1;fontColor=#007FFF;" parent="1" vertex="1">
<mxGeometry x="-420" y="1134" width="320" height="105" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-193" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;endArrow=block;endFill=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-194" target="QhXQWBFm0-bGqjXrz0u2-192" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-194" value="<div style="text-align: center;"><font color="#000000">reactor.netty.http.server</font><font style="background-color: initial; font-size: 11px;"><font color="#000000">.</font></font><span style="background-color: initial;"><font color="#000000"><b>HttpServerTcpConfig</b></font><b style="color: rgb(0, 0, 0); font-size: 11px;">&nbsp;</b><span style="font-size: 11px;">(这里其实是</span><b style="font-size: 11px;">装饰器模式</b><span style="font-size: 11px;">)</span></span></div><hr style="font-size: 11px;" size="1"><p style="margin: 0px 0px 0px 4px; font-size: 11px;"><font style="font-size: 11px;" color="#000000"><br></font></p><p style="margin: 0px 0px 0px 4px; font-size: 11px;"><font style="font-size: 11px;" color="#000000">final Function&lt;? super ServerBootstrap, ? extends ServerBootstrap&gt; bootstrapMapper;</font><br></p>" style="verticalAlign=top;align=left;overflow=fill;fontSize=12;fontFamily=Helvetica;html=1;fontColor=#007FFF;" parent="1" vertex="1">
<mxGeometry x="-480" y="1281" width="440" height="79" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-205" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;dashed=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-202" target="QhXQWBFm0-bGqjXrz0u2-204" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-202" value="<div style=""><font style="font-size: 8px;">return forwardedEnabled ? this.tcpConfiguration(FORWARD_ATTR_CONFIG) : this.<b>tcpConfiguration</b>(FORWARD_ATTR_DISABLE);</font><br></div>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;align=left;" parent="1" vertex="1">
<mxGeometry x="2880" y="1479" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-204" value="<div style="">hcc.<b>forwarded</b> = false;<br style="font-size: 10px;"></div><div style="">同上</div>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;align=center;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" vertex="1">
<mxGeometry x="3120" y="1479" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-210" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;dashed=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-206" target="QhXQWBFm0-bGqjXrz0u2-209" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-206" value="<div style="">NettyWebServerFactoryCustomizer#<br>apply()</div>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;align=center;" parent="1" vertex="1">
<mxGeometry x="3120" y="1559" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-87" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-209" target="ALvgZmMKo5qc2uUOR07o-86" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-209" value="<div style="">tcp -&gt; tcp.<b>bootstrap</b>(b -&gt; HttpServerConfiguration.decoder(b, decoder))<br></div>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;align=center;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" vertex="1">
<mxGeometry x="3360" y="1559" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-211" value="<font style="font-size: 10px;">HttpRequestDecoderSpec</font>" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1">
<mxGeometry x="3390" y="1529" width="140" height="30" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-212" value="<div style="font-size: 11px;"><font style="font-size: 11px;" color="#007fff"><b>httpServer</b> = {HttpServerTcpConfig@5566}&nbsp;</font></div><div style="font-size: 11px;"><font style="font-size: 11px;" color="#007fff">&nbsp;<b>tcpServerMapper</b> = {HttpRequestDecoderSpec$lambda@5567}&nbsp;</font></div><div style="font-size: 11px;"><font style="font-size: 11px;" color="#007fff">&nbsp; arg$1 = {HttpRequestDecoderSpec@5568}&nbsp;</font></div><div style="font-size: 11px;"><font style="font-size: 11px;" color="#007fff">&nbsp; &nbsp;maxInitialLineLength = 4096</font></div><div style="font-size: 11px;"><font style="font-size: 11px;" color="#007fff">&nbsp; &nbsp;maxHeaderSize = 8192</font></div><div style="font-size: 11px;"><font style="font-size: 11px;" color="#007fff">&nbsp; &nbsp;maxChunkSize = 8192</font></div><div style="font-size: 11px;"><font style="font-size: 11px;" color="#007fff">&nbsp; &nbsp;validateHeaders = true</font></div><div style="font-size: 11px;"><font style="font-size: 11px;" color="#007fff">&nbsp; &nbsp;initialBufferSize = 128</font></div><div style="font-size: 11px;"><font style="font-size: 11px;" color="#007fff">&nbsp;<b>source</b> = {HttpServerTcpConfig@5545}&nbsp;</font></div><div style="font-size: 11px;"><font style="font-size: 11px;" color="#007fff">&nbsp; <b>tcpServerMapper</b> = {HttpServer$lambda@5543}&nbsp;</font></div><div style="font-size: 11px;"><font style="font-size: 11px;" color="#007fff">&nbsp; <b>source</b> = {HttpServerTcpConfig@5541}&nbsp;</font></div><div style="font-size: 11px;"><font style="font-size: 11px;" color="#007fff">&nbsp; &nbsp;<b>tcpServerMapper</b> = {HttpServer$lambda@5544}&nbsp;</font></div><div style="font-size: 11px;"><font style="font-size: 11px;" color="#007fff">&nbsp; &nbsp; arg$1 = {HttpProtocol[1]@5536}&nbsp;</font></div><div style="font-size: 11px;"><font style="font-size: 11px;" color="#007fff">&nbsp; &nbsp; &nbsp;0 = {HttpProtocol@5538} "HTTP11"</font></div><div style="font-size: 11px;"><font style="font-size: 11px;" color="#007fff">&nbsp; &nbsp;<b>source</b> = {HttpServerTcpConfig@5535}&nbsp;</font></div><div style="font-size: 11px;"><font style="font-size: 11px;" color="#007fff">&nbsp; &nbsp; <b>tcpServerMapper</b> = {NettyReactiveWebServerFactory$lambda@5537}&nbsp;</font></div><div style="font-size: 11px;"><font style="font-size: 11px;" color="#007fff">&nbsp; &nbsp; <b>source</b> = {HttpServerBind@4821}&nbsp;</font></div><div style="font-size: 11px;"><font style="font-size: 11px;" color="#007fff">&nbsp; &nbsp; &nbsp;<b>tcpServer</b> = {TcpServerBind@5522}&nbsp;</font></div><div style="font-size: 11px;"><font style="font-size: 11px;" color="#007fff">&nbsp; &nbsp; &nbsp; <b>serverBootstrap</b> = {ServerBootstrap@5569}&nbsp;</font></div><div style="font-size: 11px;"><font style="font-size: 11px;" color="#007fff">&nbsp; &nbsp; &nbsp; &nbsp;childOptions = {ConcurrentHashMap@5572}&nbsp; size = 2</font></div><div style="font-size: 11px;"><font style="font-size: 11px;" color="#007fff">&nbsp; &nbsp; &nbsp; &nbsp;childAttrs = {ConcurrentHashMap@5573}&nbsp; size = 0</font></div><div style="font-size: 11px;"><font style="font-size: 11px;" color="#007fff">&nbsp; &nbsp; &nbsp; &nbsp;config = {ServerBootstrapConfig@5574}&nbsp;<br></font></div>" style="text;html=1;align=left;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1">
<mxGeometry x="-1800" y="800" width="390" height="300" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-214" value="<div style="text-align: center;"><font color="#000000">org.springframework.boot.web.embedded.netty.</font><span style="color: rgb(0, 0, 0); background-color: initial;"><b>NettyWebServer</b></span></div><hr style="font-size: 11px;" size="1"><p style="margin: 0px 0px 0px 4px; font-size: 11px;"><font style="font-size: 11px;">// webflux HTTP服务器实现类</font></p><p style="margin: 0px 0px 0px 4px; font-size: 11px;"><font style="font-size: 11px;" color="#000000"><br></font></p><p style="margin: 0px 0px 0px 4px;"><font color="#000000">private static final Predicate&lt;HttpServerRequest&gt; ALWAYS = (r) -&gt; true;</font></p><p style="margin: 0px 0px 0px 4px;"><font color="#000000"><span style="font-size: 11px;">private final <b>HttpServer</b> <b>httpServer</b>;</span></font></p><p style="margin: 0px 0px 0px 4px;"><span style="font-size: 11px;">// 路由定义方式1: HttpHandler适配器</span></p><p style="margin: 0px 0px 0px 4px;"><font color="#000000"><span style="font-size: 11px;">private final ReactorHttpHandlerAdapter <b>handlerAdapter</b>;</span></font></p><p style="margin: 0px 0px 0px 4px;"><font color="#000000"><span style="font-size: 11px;">private final Duration <b>lifecycleTimeout</b>;</span></font></p><p style="margin: 0px 0px 0px 4px;"><span style="font-size: 11px;">// 路由定义方式2: NettyRouteProvider</span></p><p style="margin: 0px 0px 0px 4px;"><font color="#000000"><span style="font-size: 11px;">private List&lt;NettyRouteProvider&gt; <b>routeProviders</b> = Collections.emptyList();</span></font></p><p style="margin: 0px 0px 0px 4px;"><font color="#000000"><span style="font-size: 11px;">private DisposableServer <b>disposableServer</b>;</span></font></p>" style="verticalAlign=top;align=left;overflow=fill;fontSize=12;fontFamily=Helvetica;html=1;fontColor=#007FFF;" parent="1" vertex="1">
<mxGeometry x="-480" y="1400" width="440" height="180" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-218" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-215" target="QhXQWBFm0-bGqjXrz0u2-217" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-215" value="finishRefresh();" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="1280.5" y="1590" width="160" height="60" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-220" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-217" target="QhXQWBFm0-bGqjXrz0u2-219" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-217" value="super.finishRefresh();" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="1480.5" y="1590" width="160" height="60" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-222" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-219" target="QhXQWBFm0-bGqjXrz0u2-221" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-226" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-219" target="QhXQWBFm0-bGqjXrz0u2-225" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-219" value="WebServer webServer = startReactiveWebServer();" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="1480.5" y="1670" width="160" height="60" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-221" value="<font style="font-size: 9px;">publishEvent(new <b>ReactiveWebServerInitializedEvent</b>(<br>webServer, this));<br><font color="#007fff">暂时没搜到源码哪里有监听这个事件,先略,或许是给开发者预留的拓展</font><br></font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="1480.5" y="1830" width="160" height="60" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-229" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-225" target="QhXQWBFm0-bGqjXrz0u2-230" edge="1">
<mxGeometry relative="1" as="geometry">
<mxPoint x="1919.5" y="1700" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="0TajKGxzIfMUDPpfPPpd-11" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-225" target="0TajKGxzIfMUDPpfPPpd-10" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-225" value="ServerManager serverManager = this.serverManager;<br>ServerManager.<b>start</b>(<b>serverManager</b>, this::getHttpHandler);" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="1679.5" y="1670" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-227" value="<font style="font-size: 10px;">ReactiveWebServerApplicationContext</font>" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1">
<mxGeometry x="1459.5" y="1560" width="200" height="30" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-233" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-230" target="QhXQWBFm0-bGqjXrz0u2-232" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-235" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-230" target="QhXQWBFm0-bGqjXrz0u2-234" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-230" value="<div style="font-size: 9px;"><font style="font-size: 9px;">manager.<b>handler</b> = manager.lazyInit ?&nbsp;</font></div><div style="font-size: 9px;"><font style="font-size: 9px;">new LazyHttpHandler(</font></div><div style="font-size: 9px;"><font style="font-size: 9px;">Mono.fromSupplier(handlerSupplier))</font></div><div style="font-size: 9px;"><font style="font-size: 9px;">: <b>handlerSupplier</b>.get();</font><span style=""></span></div>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="1920.5" y="1670" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-23" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-232" target="ALvgZmMKo5qc2uUOR07o-22" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-232" value="<div style=""><font size="1">manager.server.start();</font><br></div>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fillColor=#fff2cc;strokeColor=#d6b656;" parent="1" vertex="1">
<mxGeometry x="1920.5" y="1770" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-234" value="ReactiveWebServerApplicationContext#<br><b>getHttpHandler</b>()<br><font color="#007fff">这个时候才初始化请求处理器,是<b>HttpWebHandlerAdapter</b>类型的Bean, 由<br>HttpHandlerAutoConfiguration创建<br></font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fillColor=#fff2cc;strokeColor=#d6b656;" parent="1" vertex="1">
<mxGeometry x="2160.5" y="1670" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-244" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-236" target="QhXQWBFm0-bGqjXrz0u2-241" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="O3d2Nxprm6Z4arKHyfC2-2" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-236" target="O3d2Nxprm6Z4arKHyfC2-1" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-236" value="<font style=""><font style="font-size: 10px;">WebFluxAutoConfiguration</font><br></font>" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" parent="1" vertex="1">
<mxGeometry x="840" y="280" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-238" value="<font style="font-size: 10px;">reactor-netty<br>spring-webflux<br>...<br></font>" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="640" y="280" width="160" height="60" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-247" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-241" target="QhXQWBFm0-bGqjXrz0u2-246" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-241" value="<font style=""><font style="font-size: 10px;">HttpHandlerAutoConfiguration</font><br></font>" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" parent="1" vertex="1">
<mxGeometry x="840" y="360" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-243" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-242" target="QhXQWBFm0-bGqjXrz0u2-236" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-242" value="<font style=""><font style="font-size: 10px;">ReactiveWebServerFactoryAutoConfiguration</font><br></font>" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" parent="1" vertex="1">
<mxGeometry x="840" y="200" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="O3d2Nxprm6Z4arKHyfC2-9" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;dashed=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-246" target="O3d2Nxprm6Z4arKHyfC2-7" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-246" value="<font style=""><font style="font-size: 10px;">AnnotationConfig#httpHandler()<br></font><font style="font-size: 10px;" color="#007fff">AnnotationConfig 是配置类</font><br></font>" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="1080.5" y="360" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="O3d2Nxprm6Z4arKHyfC2-11" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-248" target="QhXQWBFm0-bGqjXrz0u2-250" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-248" value="<font style=""><font style="font-size: 10px;"><b>WebHttpHandlerBuilder</b>#build();</font><br></font>" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="1320" y="440" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-254" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-250" target="QhXQWBFm0-bGqjXrz0u2-234" edge="1">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="1660" y="1620" />
<mxPoint x="2261" y="1620" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="QhXQWBFm0-bGqjXrz0u2-250" value="<font style="font-size: 10px;"><font style="font-size: 10px;">HttpWebHandlerAdapter adapted = new <b>HttpWebHandlerAdapter</b>(decorated);<br>...<br></font>return adapted;<br></font>" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" parent="1" vertex="1">
<mxGeometry x="1560" y="440" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="O3d2Nxprm6Z4arKHyfC2-6" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;dashed=1;" parent="1" source="O3d2Nxprm6Z4arKHyfC2-1" target="O3d2Nxprm6Z4arKHyfC2-5" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="O3d2Nxprm6Z4arKHyfC2-1" value="<font style=""><font style="font-size: 10px;">EnableWebFluxConfiguration</font><br></font>" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="1080.5" y="280" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="O3d2Nxprm6Z4arKHyfC2-3" value="<font style="font-size: 10px;">org.springframework.boot.autoconfigure.web.reactive</font>" style="text;html=1;align=left;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1">
<mxGeometry x="840" y="160" width="260" height="30" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-1" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.75;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" source="O3d2Nxprm6Z4arKHyfC2-5" target="O3d2Nxprm6Z4arKHyfC2-12" edge="1">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="1540" y="325" />
<mxPoint x="1540" y="350" />
<mxPoint x="1660" y="350" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-7" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="O3d2Nxprm6Z4arKHyfC2-5" target="ALvgZmMKo5qc2uUOR07o-6" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="O3d2Nxprm6Z4arKHyfC2-5" value="<font style=""><font style="font-size: 10px;">WebFluxConfigurationSupport#<br><b>webHandler</b>()<br></font><font style="font-size: 10px;" color="#007fff">创建DispatcherHandler Bean</font><br></font>" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="1320" y="280" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="O3d2Nxprm6Z4arKHyfC2-10" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" parent="1" source="O3d2Nxprm6Z4arKHyfC2-7" target="QhXQWBFm0-bGqjXrz0u2-248" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="O3d2Nxprm6Z4arKHyfC2-13" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="O3d2Nxprm6Z4arKHyfC2-7" target="O3d2Nxprm6Z4arKHyfC2-12" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="O3d2Nxprm6Z4arKHyfC2-7" value="<font style=""><font style="font-size: 10px;">WebHttpHandlerBuilder#<br><b>applicationContext</b>(<br>this.applicationContext)</font><br></font>" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="1320" y="360" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="O3d2Nxprm6Z4arKHyfC2-12" value="<font style="font-size: 8px;">基于 WebHandler 创建WebHttpHandlerBuilder 实例,然后装配上过滤器、统一异常处理、会话管理、编解码器、国际化Resolver、ForwardedHeaderTransformer<br></font>" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="1560" y="360" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="O3d2Nxprm6Z4arKHyfC2-14" value="这里创建的FilteringWebHandler" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1">
<mxGeometry x="1760" y="455" width="190" height="30" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-4" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;" parent="1" source="O3d2Nxprm6Z4arKHyfC2-15" target="O3d2Nxprm6Z4arKHyfC2-16" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-5" value="构建" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="ALvgZmMKo5qc2uUOR07o-4" vertex="1" connectable="0">
<mxGeometry x="-0.2379" y="4" relative="1" as="geometry">
<mxPoint y="-5" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="O3d2Nxprm6Z4arKHyfC2-15" value="<div style="text-align: center; font-size: 11px;"><font style="font-size: 11px;"><font style="font-size: 11px;" color="#330000">org.springframework.web.server.adapter</font><font style="background-color: initial; font-size: 11px;"><font style="font-size: 11px;" color="#330000">.</font></font><b style="background-color: initial; color: rgb(51, 0, 0);">WebHttpHandlerBuilder</b></font></div><hr style="font-size: 11px;" size="1"><p style="margin: 0px 0px 0px 4px; font-size: 11px;">HTTP请求分发处理器Builder</p><p style="margin: 0px 0px 0px 4px; font-size: 11px;"><br></p><p style="margin: 0px 0px 0px 4px;"><font color="#330000"><b>webHandler</b> = {<b>DispatcherHandler</b>@5193}&nbsp;</font></p><p style="margin: 0px 0px 0px 4px;"><font color="#330000"><span style="font-size: 11px;"><b>applicationContext</b> = {AnnotationConfigReactiveWebServerApplicationContext@3429}&nbsp;</span></font></p><p style="margin: 0px 0px 0px 4px;"><font color="#330000"><span style="font-size: 11px;"><b>filters</b> = {ArrayList@5194}&nbsp; size = 0</span></font></p><p style="margin: 0px 0px 0px 4px;"><font color="#330000"><span style="font-size: 11px;"><b>exceptionHandlers</b> = {ArrayList@5195}&nbsp; size = 2</span></font></p><p style="margin: 0px 0px 0px 4px;"><font color="#330000"><span style="font-size: 11px;">&nbsp;0 = {DefaultErrorWebExceptionHandler@5680}&nbsp;</span></font></p><p style="margin: 0px 0px 0px 4px;"><font color="#330000"><span style="font-size: 11px;">&nbsp;1 = {WebFluxResponseStatusExceptionHandler@5681}&nbsp;</span></font></p><p style="margin: 0px 0px 0px 4px;"><font color="#330000"><span style="font-size: 11px;"><b>sessionManager</b> = null</span></font></p><p style="margin: 0px 0px 0px 4px;"><font color="#330000"><span style="font-size: 11px;"><b>codecConfigurer</b> = {DefaultServerCodecConfigurer@5676}&nbsp;</span></font></p><p style="margin: 0px 0px 0px 4px;"><font color="#330000"><span style="font-size: 11px;"><b>localeContextResolver</b> = {AcceptHeaderLocaleContextResolver@5677}&nbsp;</span></font></p><p style="margin: 0px 0px 0px 4px;"><font color="#330000"><span style="font-size: 11px;"><b>forwardedHeaderTransformer</b> = null</span></font></p><p style="margin: 0px 0px 0px 4px; font-size: 11px;"><br></p>" style="verticalAlign=top;align=left;overflow=fill;fontSize=12;fontFamily=Helvetica;html=1;fontColor=#007FFF;" parent="1" vertex="1">
<mxGeometry x="-1480" y="480" width="440" height="220" as="geometry" />
</mxCell>
<mxCell id="O3d2Nxprm6Z4arKHyfC2-16" value="<div style="text-align: center; font-size: 11px;"><font style="font-size: 11px;"><font style="font-size: 11px;"><font style="font-size: 11px;" color="#330000">org.springframework.web.server.adapter</font><font style="background-color: initial; font-size: 11px;"><font style="font-size: 11px;" color="#330000">.</font></font></font><b style="color: rgb(51, 0, 0); background-color: initial;">HttpWebHandlerAdapter</b></font></div><div style="text-align: center;"><font style=""><font color="#330000">extends WebHandlerDecorator implements HttpHandler<br></font><span style="background-color: initial;"></span></font></div><hr style="font-size: 11px;" size="1"><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;">实际的HTTP请求分发处理器(装饰器模式, 是装饰过后的DispatcherHandler)</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;"><br></font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;" color="#330000"><b>sessionManager</b> = {DefaultWebSessionManager@5737}&nbsp;</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;" color="#330000"><b>codecConfigurer</b> = {DefaultServerCodecConfigurer@5676}&nbsp;</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;" color="#330000"><b>localeContextResolver</b> = {AcceptHeaderLocaleContextResolver@5677}&nbsp;</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;">//</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;" color="#330000"><b>forwardedHeaderTransformer</b> = null</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;" color="#330000"><b>applicationContext</b> = {AnnotationConfigReactiveWebServerApplicationContext@3429}</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;" color="#330000">enableLoggingRequestDetails = false</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;">//继承自WebHandlerDecorator 是装饰后的DispatcherHandler</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;" color="#330000"><b>delegate</b> = {ExceptionHandlingWebHandler@5696}</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;" color="#330000">&nbsp;<b>exceptionHandlers</b> = {Collections$UnmodifiableRandomAccessList@5746}&nbsp; size = 3</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;" color="#330000">&nbsp;delegate = {FilteringWebHandler@5691}</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;" color="#330000">&nbsp; <b>chain</b> = {DefaultWebFilterChain@5748}&nbsp;</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;" color="#330000">&nbsp; delegate = {DispatcherHandler@5193}&nbsp;</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;" color="#330000">&nbsp; &nbsp;<b>handlerMappings</b> = {Collections$UnmodifiableRandomAccessList@5203}&nbsp; size = 3</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;" color="#330000">&nbsp; &nbsp;<b>handlerAdapters</b> = {ArrayList@5204}&nbsp; size = 3</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;" color="#330000">&nbsp; &nbsp;<b style="">resultHandlers</b> = {ArrayList@5205}&nbsp; size = 4</font></p><p style="margin: 0px 0px 0px 4px; font-size: 11px;"><br></p>" style="verticalAlign=top;align=left;overflow=fill;fontSize=12;fontFamily=Helvetica;html=1;fontColor=#007FFF;" parent="1" vertex="1">
<mxGeometry x="-1960" y="440" width="440" height="260" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-3" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;endArrow=diamondThin;endFill=1;" parent="1" source="ALvgZmMKo5qc2uUOR07o-2" target="O3d2Nxprm6Z4arKHyfC2-15" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-2" value="<div style="text-align: center;"><font color="#330000">org.springframework.web.reactive</font><font style="font-size: 11px; background-color: initial;"><font style="background-color: initial;"><font color="#330000">.</font></font></font><b style="background-color: initial; color: rgb(51, 0, 0);">DispatcherHandler</b></div><hr style="font-size: 11px;" size="1"><p style="margin: 0px 0px 0px 4px; font-size: 11px;">请求分发处理器, 对标Servlet服务器的 <b>DispatcherServlet, </b>继承WebHandler接口</p><p style="margin: 0px 0px 0px 4px; font-size: 11px;"><br></p><p style="margin: 0px 0px 0px 4px; font-size: 11px;">//定义 请求路由 -&gt; 请求处理方法 的映射(Map)</p><p style="margin: 0px 0px 0px 4px;"><font color="#330000">private List&lt;<b>HandlerMapping</b>&gt; <b>handlerMappings</b>;</font></p><p style="margin: 0px 0px 0px 4px;">//请求处理适配器,适配不同的请求处理器定义方式(比如@RequestMapping、<br><span style="white-space: pre;">	</span>RouterFunction<span style="background-color: initial;">)</span></p><p style="margin: 0px 0px 0px 4px;"><font color="#330000">private List&lt;<b>HandlerAdapter</b>&gt; <b>handlerAdapters</b>;</font></p><p style="margin: 0px 0px 0px 4px;">//响应结果处理器,比如结果序列化</p><p style="margin: 0px 0px 0px 4px;"><font color="#330000">private List&lt;<b>HandlerResultHandler</b>&gt; <b>resultHandlers</b>;</font></p><p style="margin: 0px 0px 0px 4px; font-size: 11px;"><br></p>" style="verticalAlign=top;align=left;overflow=fill;fontSize=12;fontFamily=Helvetica;html=1;fontColor=#007FFF;" parent="1" vertex="1">
<mxGeometry x="-1480" y="300" width="440" height="160" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-9" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="ALvgZmMKo5qc2uUOR07o-6" target="ALvgZmMKo5qc2uUOR07o-8" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-6" value="<font style="font-size: 10px;">return new <b>DispatcherHandler</b>();</font>" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" parent="1" vertex="1">
<mxGeometry x="1560" y="280" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-11" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="ALvgZmMKo5qc2uUOR07o-8" target="ALvgZmMKo5qc2uUOR07o-10" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-8" value="<font style="font-size: 10px;">initStrategies(applicationContext);<br><font style="font-size: 10px;" color="#007fff"><font style="font-size: 10px;">初始化三大组件:</font><span style="">HandlerMapping、<br></span>HandlerAdapter、HandlerResultHandler</font><br></font>" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="1799.5" y="280" width="200.5" height="60" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-10" value="<font style="font-size: 10px;">BeanFactoryUtils<br><span style="">.beansOfTypeIncludingAncestors(...);</span><br><span style="">AnnotationAwareOrderComparator.sort(...);</span><br><font style="font-size: 10px;" color="#007fff">这里是获取</font><font style="font-size: 10px;" color="#007fff"><span style=""><span style="background-color: initial;">HandlerMapping、<br></span><span style="background-color: initial;">HandlerAdapter、HandlerResultHandler</span></span></font><font style="font-size: 10px;" color="#007fff">类型或其子类型的Bean,并排序</font><br></font>" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" parent="1" vertex="1">
<mxGeometry x="2039.5" y="270" width="200.5" height="80" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-16" value="TODO" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1">
<mxGeometry x="2245" y="295" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-21" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="ALvgZmMKo5qc2uUOR07o-17" target="ALvgZmMKo5qc2uUOR07o-20" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-17" value="<div>请求进来先是通过Netty ChannelPipeline传递到</div><div><b>HttpTrafficHandler</b></div>" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="240" y="1840" width="160" height="60" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-19" value="<font color="#007fff">关于Netty原理参考<br>netty-analysis</font>" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1">
<mxGeometry x="260" y="1901" width="120" height="40" as="geometry" />
</mxCell>
<mxCell id="u_z_PSljN5TfgaHLhyht-9" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="ALvgZmMKo5qc2uUOR07o-20" target="u_z_PSljN5TfgaHLhyht-8" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-20" value="<font style="font-size: 10px;"><b>channelRead</b>(ChannelHandlerContext ctx, Object msg)</font>" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" parent="1" vertex="1">
<mxGeometry x="440" y="1840" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-26" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="ALvgZmMKo5qc2uUOR07o-22" target="ALvgZmMKo5qc2uUOR07o-25" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="u_z_PSljN5TfgaHLhyht-2" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="ALvgZmMKo5qc2uUOR07o-22" target="u_z_PSljN5TfgaHLhyht-1" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-22" value="<div style=""><font size="1">this.disposableServer = startHttpServer();</font><br></div>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="2160.5" y="1770" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-24" value="NettyWebServer" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1">
<mxGeometry x="2206" y="1739" width="110" height="30" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-28" value="Y" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="ALvgZmMKo5qc2uUOR07o-25" target="ALvgZmMKo5qc2uUOR07o-27" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-31" value="N" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="ALvgZmMKo5qc2uUOR07o-25" target="ALvgZmMKo5qc2uUOR07o-29" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-33" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="ALvgZmMKo5qc2uUOR07o-25" target="ALvgZmMKo5qc2uUOR07o-32" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-25" value="this.<b>routeProviders</b><br>.isEmpty()" style="rhombus;whiteSpace=wrap;html=1;fontSize=10;rounded=1;" parent="1" vertex="1">
<mxGeometry x="2421" y="1760" width="120" height="80" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-38" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="ALvgZmMKo5qc2uUOR07o-27" target="ALvgZmMKo5qc2uUOR07o-37" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-27" value="server = server.handle(this.handlerAdapter);" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;" parent="1" vertex="1">
<mxGeometry x="2600.5" y="1770" width="160.5" height="60" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-29" value="server = server.route(<br>this::applyRouteProviders);<br><font color="#007fff">默认 routeProviders为空,这步先略</font>" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;" parent="1" vertex="1">
<mxGeometry x="2600.5" y="1851" width="160.5" height="60" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-40" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="ALvgZmMKo5qc2uUOR07o-32" target="ALvgZmMKo5qc2uUOR07o-39" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-32" value="return server.bindNow();" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="2401" y="1930" width="160" height="60" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-35" style="rounded=1;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;endArrow=block;endFill=1;" parent="1" source="ALvgZmMKo5qc2uUOR07o-34" target="QhXQWBFm0-bGqjXrz0u2-192" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-34" value="<div style="text-align: center; font-size: 10px;"><font style="font-size: 11px;"><font style="font-size: 11px;" color="#000000">reactor.netty.http.server</font><font style="background-color: initial; font-size: 11px;"><font style="font-size: 11px;" color="#000000">.</font></font><span style="background-color: initial;"><font style="font-size: 11px;" color="#000000"><b>HttpServerHandle</b></font><b style="color: rgb(0, 0, 0);">&nbsp;</b>(<b style="">装饰器模式</b>)</span></font></div><hr style="font-size: 10px;" size="1"><p style="margin: 0px 0px 0px 4px; font-size: 10px;"></p><font style="font-size: 10px;"><font style="font-size: 10px;">//封装了前面的HttpWebHandlerAdapter, Adapter也经过层层装饰这里是ReactorHttpHandlerAdapter</font><br><span style="font-size: 11px; color: rgb(0, 0, 0); background-color: initial;">final BiFunction&lt;? super HttpServerRequest, ? super</span><br></font><p style="margin: 0px 0px 0px 4px; font-size: 11px;"><font style="font-size: 11px;" color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HttpServerResponse, ? extends Publisher&lt;Void&gt;&gt; <b style="">handler</b>;</font></p>" style="verticalAlign=top;align=left;overflow=fill;fontSize=12;fontFamily=Helvetica;html=1;fontColor=#007FFF;" parent="1" vertex="1">
<mxGeometry x="-960" y="1281" width="440" height="79" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-37" value="<font style="">this.handler = Objects<br>.requireNonNull(handler, "handler");<br><font color="#007fff" style="font-size: 9px;">这里是在原HttpServerTcpConfig基础上装饰了ReactorHttpHandlerAdapter</font></font>" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="2799.5" y="1770" width="160.5" height="60" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-42" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="ALvgZmMKo5qc2uUOR07o-39" target="ALvgZmMKo5qc2uUOR07o-41" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-39" value="<b>bind</b>().block(timeout)<br><font style="font-size: 10px;" color="#007fff">此时server是装饰了很多层的Netty服务器,此bind()也是从内到外一层层执行的,只不过每层并没有额外添加逻辑</font>" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;fillColor=#fff2cc;strokeColor=#d6b656;" parent="1" vertex="1">
<mxGeometry x="2600.5" y="1930" width="160" height="60" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-45" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="ALvgZmMKo5qc2uUOR07o-41" target="ALvgZmMKo5qc2uUOR07o-44" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="0TajKGxzIfMUDPpfPPpd-2" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="ALvgZmMKo5qc2uUOR07o-41" target="0TajKGxzIfMUDPpfPPpd-1" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-41" value="<div>delegate.bootstrap(this)<span style="background-color: initial;">.bind()</span></div><div style=""><font size="1">.map(</font><font style="font-size: 8px;">CLEANUP_GLOBAL_RESOURCE</font><font size="1">);</font></div>" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="2800" y="1930" width="160" height="60" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-43" value="<font style="font-size: 10px;">HttpServerBind</font>" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1">
<mxGeometry x="2835" y="1900" width="90" height="30" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-47" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="ALvgZmMKo5qc2uUOR07o-44" target="ALvgZmMKo5qc2uUOR07o-46" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-95" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;dashed=1;" parent="1" source="ALvgZmMKo5qc2uUOR07o-44" target="ALvgZmMKo5qc2uUOR07o-94" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-44" value="new <b>TcpServerBootstrap</b>(this, bootstrapMapper);" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="2999.75" y="1930" width="160" height="60" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-49" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="ALvgZmMKo5qc2uUOR07o-46" target="ALvgZmMKo5qc2uUOR07o-48" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-51" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="ALvgZmMKo5qc2uUOR07o-46" target="ALvgZmMKo5qc2uUOR07o-50" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-46" value="b = <b>configure</b>();<br><font color="#007fff">此处ServerBootstrap(b)经过了层层装饰</font>" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;fillColor=#fff2cc;strokeColor=#d6b656;" parent="1" vertex="1">
<mxGeometry x="2999.75" y="2011" width="160" height="60" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-78" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="ALvgZmMKo5qc2uUOR07o-48" target="ALvgZmMKo5qc2uUOR07o-77" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-48" value="bootstrapMapper<br>.<b>apply</b>(source.<b>configure</b>())<br><font color="#007fff">这里就是从内到外一层层地执行apply方法</font>" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="3199.25" y="2011" width="160" height="60" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-104" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="ALvgZmMKo5qc2uUOR07o-50" target="ALvgZmMKo5qc2uUOR07o-103" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-50" value="return bind(b);<br><font color="#007fff">此bind()也是从内到外一层层执行的,只不过每层并没有额外添加逻辑,只看最内层实现</font>" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;fillColor=#fff2cc;strokeColor=#d6b656;" parent="1" vertex="1">
<mxGeometry x="2999.75" y="2250" width="160" height="60" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-58" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="ALvgZmMKo5qc2uUOR07o-55" target="ALvgZmMKo5qc2uUOR07o-57" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-64" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="ALvgZmMKo5qc2uUOR07o-55" target="ALvgZmMKo5qc2uUOR07o-63" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-55" value="<div style="text-align: center;"><font size="1">EventLoopGroup selectorGroup = resources.onServerSelect(preferNative);</font><br></div><div style="text-align: center;"><font color="#007fff" size="1">创建Selector线程组(boss线程组),<br>默认还会被当作worker线程组</font></div>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;align=left;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="3120" y="979" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-59" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" parent="1" source="ALvgZmMKo5qc2uUOR07o-57" target="QhXQWBFm0-bGqjXrz0u2-162" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-69" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="ALvgZmMKo5qc2uUOR07o-57" target="ALvgZmMKo5qc2uUOR07o-68" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-57" value="<div style="text-align: center;"><font size="1">EventLoopGroup elg = resources.onServer(preferNative);</font><br></div><div style="text-align: center;"><font color="#007fff" size="1">获取工作者线程组,其实还是上一组线程组,这里直接从缓存返回</font></div>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;align=left;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="3120" y="1059" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-61" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="QhXQWBFm0-bGqjXrz0u2-147" target="ALvgZmMKo5qc2uUOR07o-60" edge="1">
<mxGeometry relative="1" as="geometry">
<mxPoint x="2740" y="919" as="sourcePoint" />
<mxPoint x="2740" y="1119" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-60" value="LoopResources resources = this.<b>resourceFactory</b>.getLoopResources();" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="2640" y="1059" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-62" value="NettyReactiveWebServerFactory" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1">
<mxGeometry x="2640" y="829" width="200" height="30" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-72" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" parent="1" source="ALvgZmMKo5qc2uUOR07o-63" target="ALvgZmMKo5qc2uUOR07o-70" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-63" value="<div style=""><font size="1">return cacheNativeSelectLoops();</font><br></div><div style=""><font size="1"><font color="#007fff">先从缓存中获取EventLoopGroup,没有则创建,</font><font style="font-weight: bold;" color="#007fff">默认boss线程组和worker线程组是一组线程,</font><font style="" color="#ea6b66">为何要共用同一组线程</font></font></div>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;align=center;" parent="1" vertex="1">
<mxGeometry x="3360" y="979" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-65" value="<div style=""><font size="1">new <b>EpollEventLoopGroup</b>(threads, factory);<br></font><font color="#007fff">本地环境是Linux,所以基于Epoll</font></div>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;align=center;fillColor=#dae8fc;strokeColor=#6c8ebf;arcSize=8;" parent="1" vertex="1">
<mxGeometry x="3840" y="979" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-67" value="<div style="text-align: center; font-size: 10px;"><font style="font-size: 10px;"><font style="font-size: 10px;" color="#000000">reactor.netty.resources</font><font style="background-color: initial; font-size: 10px;" color="#000000">.</font><b style="color: rgb(0, 0, 0); background-color: initial;">DefaultLoopResources</b></font></div><hr style="font-size: 10px;" size="1"><font style="font-size: 10px;">&nbsp;用于客户端和服务端创建并缓存EventLoopGroup(一组线程)的,<br>&nbsp;可以当作EventLoopGroup的工厂+管理器</font><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;" color="#000000"><br></font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;">//线程名前缀</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;" color="#000000">final String&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <b>prefix</b>;</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;">//是否是守护线程</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;" color="#000000">final boolean&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<b>daemon</b>;</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;">//selector线程(即boss线程,分发请求)数量</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;" color="#000000">final int&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<b>selectCount</b>;</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;">//工作线程(处理请求)数量</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;" color="#000000">final int&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<b>workerCount</b>;</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;" color="#000000"><br></font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;">//这三组功能同后面的三组EventLoopGroup,只是基于 <b>NioEventLoopGroup</b></font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;"><b>//后面三组基于 projectreactor DefaultLoopEpoll,</b>不过记得本质都是一样的,底层都是epoll,</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;">只是封装不同, 默认用 useNative = true, 即用DefaultLoopEpoll</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;" color="#000000">final AtomicReference&lt;EventLoopGroup&gt; <b>serverLoops</b>;</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;" color="#000000">final AtomicReference&lt;EventLoopGroup&gt; <b>clientLoops</b>;</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;" color="#000000">final AtomicReference&lt;EventLoopGroup&gt; <b>serverSelectLoops</b>;</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;">//客户端线程组(并不等同于连接线程)</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;" color="#000000">final AtomicReference&lt;EventLoopGroup&gt; <b>cacheNativeClientLoops</b>;</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;">//服务端worker线程组,默认情况下和boss线程组是同一组线程,</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;">//调试可以发现和下面的cacheNativeSelectLoops中的线程组是同一个对象</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;" color="#000000">final AtomicReference&lt;EventLoopGroup&gt; <b>cacheNativeServerLoops</b>;</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;">//服务端Selector(boss)线程组</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;" color="#000000">final AtomicReference&lt;EventLoopGroup&gt; <b>cacheNativeSelectLoops</b>;</font></p><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;" color="#000000">final AtomicBoolean&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;running;</font></p>" style="verticalAlign=top;align=left;overflow=fill;fontSize=12;fontFamily=Helvetica;html=1;fontColor=#007FFF;" parent="1" vertex="1">
<mxGeometry x="-480" y="1600" width="440" height="360" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-68" value="<div style=""><font size="1">return cacheNativeServerLoops();</font><br></div>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;align=center;" parent="1" vertex="1">
<mxGeometry x="3360" y="1059" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-73" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" parent="1" source="ALvgZmMKo5qc2uUOR07o-70" target="ALvgZmMKo5qc2uUOR07o-65" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-70" value="<div style="font-size: 8px;"><div style="">DefaultLoop defaultLoop = DefaultLoopNativeDetector.getInstance();</div><div style="">EventLoopGroup newEventLoopGroup = defaultLoop.<b>newEventLoopGroup</b>(</div><div style="">workerCount,</div><div style="">threadFactory(this, defaultLoop.getName()));</div><div style="">cacheNativeServerLoops.compareAndSet(null, newEventLoopGroup)<br></div></div>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;align=left;arcSize=6;" parent="1" vertex="1">
<mxGeometry x="3599.5" y="969.5" width="200" height="79" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-74" value="<font style="font-size: 10px;" color="#007fff">这里 AtomicReference + CAS 实现锁的效果</font>" style="text;html=1;align=left;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1">
<mxGeometry x="3599.5" y="935" width="220" height="30" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-75" value="<div style=""><font size="1">DefaultLoopNativeDetector.getInstance()</font></div><div style=""><font size="1">.<b>getServerChannel</b>(group)</font><br></div><div style=""><font color="#007fff" size="1">这个是native实现(projectreactor的封装)<br><b>EpollServerSocketChannel</b><br></font></div>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;align=center;" parent="1" vertex="1">
<mxGeometry x="3360" y="1139" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-80" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="ALvgZmMKo5qc2uUOR07o-77" target="ALvgZmMKo5qc2uUOR07o-79" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-77" value="TcpServerBind#configure()" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="3399.25" y="2011" width="160" height="60" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-82" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="ALvgZmMKo5qc2uUOR07o-79" target="ALvgZmMKo5qc2uUOR07o-81" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-79" value="TcpServerRunOn#configure()" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="3399.25" y="2091" width="160" height="60" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-88" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.75;entryDx=0;entryDy=0;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" source="ALvgZmMKo5qc2uUOR07o-81" target="ALvgZmMKo5qc2uUOR07o-83" edge="1">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="3600" y="2200" />
<mxPoint x="3600" y="1740" />
<mxPoint x="3110" y="1740" />
<mxPoint x="3110" y="1449" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-89" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.75;entryDx=0;entryDy=0;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" source="ALvgZmMKo5qc2uUOR07o-81" target="QhXQWBFm0-bGqjXrz0u2-204" edge="1">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="3600" y="2200" />
<mxPoint x="3600" y="1740" />
<mxPoint x="3110" y="1740" />
<mxPoint x="3110" y="1524" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-90" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.75;entryDx=0;entryDy=0;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" source="ALvgZmMKo5qc2uUOR07o-81" target="ALvgZmMKo5qc2uUOR07o-86" edge="1">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="3600" y="2200" />
<mxPoint x="3600" y="1740" />
<mxPoint x="3580" y="1740" />
<mxPoint x="3580" y="1605" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-92" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" source="ALvgZmMKo5qc2uUOR07o-81" target="ALvgZmMKo5qc2uUOR07o-91" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-100" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.75;entryDx=0;entryDy=0;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" source="ALvgZmMKo5qc2uUOR07o-81" target="ALvgZmMKo5qc2uUOR07o-94" edge="1">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="3600" y="2200" />
<mxPoint x="3600" y="2000" />
<mxPoint x="3190" y="2000" />
<mxPoint x="3190" y="1975" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-81" value="bootstrapMapper.apply()" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="3399.25" y="2170" width="160" height="60" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-83" value="<div style=""><b>HttpServerConfiguration</b> hcc = b.config().attrs().get(CONF_KEY);<br>b.<b>attr</b>(CONF_KEY, hcc);<br></div><div style="">hcc.<b>protocols</b> = _protocols;</div><font color="#007fff">配置HTTP协议版本CONF_KEY:&nbsp;</font><span style="color: rgb(0, 127, 255); background-color: initial;">httpServerConf</span><font color="#007fff"><br></font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;align=center;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" vertex="1">
<mxGeometry x="3120" y="1389" width="200" height="80" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-86" value="<div style=""><div>hcc.<b>decoder</b> =&nbsp;decoder<span style="background-color: initial;">;</span><br></div><div>同上</div></div>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;align=center;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" vertex="1">
<mxGeometry x="3599.5" y="1560" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-91" value="b.<b>childOption</b>(OBSERVER_OPTION, connectionObserver);" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" vertex="1">
<mxGeometry x="3640" y="2170" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-93" value="HttpServerHandle" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1">
<mxGeometry x="3680" y="2139.5" width="120" height="30" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-97" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="ALvgZmMKo5qc2uUOR07o-94" target="ALvgZmMKo5qc2uUOR07o-96" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-94" value="apply()" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;" parent="1" vertex="1">
<mxGeometry x="3199.25" y="1930" width="100.5" height="60" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-98" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.75;entryDx=0;entryDy=0;fillColor=#d5e8d4;strokeColor=#82b366;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" parent="1" source="ALvgZmMKo5qc2uUOR07o-79" target="ALvgZmMKo5qc2uUOR07o-55" edge="1">
<mxGeometry relative="1" as="geometry">
<mxPoint x="3800" y="2121" as="sourcePoint" />
<mxPoint x="3120" y="1024" as="targetPoint" />
<Array as="points">
<mxPoint x="3580" y="2121" />
<mxPoint x="3580" y="1750" />
<mxPoint x="3100" y="1750" />
<mxPoint x="3100" y="1024" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-99" value="触发执行" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];fontColor=#97D077;" parent="ALvgZmMKo5qc2uUOR07o-98" vertex="1" connectable="0">
<mxGeometry x="-0.9583" relative="1" as="geometry">
<mxPoint x="30" y="2" as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-102" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="ALvgZmMKo5qc2uUOR07o-96" target="ALvgZmMKo5qc2uUOR07o-101" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-96" value="<div style="font-size: 8px;"><font style="font-size: 8px;">BootstrapHandlers.updateConfiguration(b,</font></div><div style="font-size: 8px;"><font style="font-size: 8px;">&nbsp; &nbsp; NettyPipeline.<b>HttpInitializer</b>,</font></div><div style="font-size: 8px;"><font style="font-size: 8px;">&nbsp; &nbsp; new <b>Http1Initializer</b>(conf.decoder.maxInitialLineLength(),</font></div><div style="font-size: 8px;"><font style="font-size: 8px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; conf.decoder.maxHeaderSize(),</font></div><div style="font-size: 8px;"><font style="font-size: 8px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; conf.decoder.maxChunkSize(),</font></div><div style="font-size: 8px;"><font style="font-size: 8px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; conf.decoder.validateHeaders(),</font></div><div style="font-size: 8px;"><font style="font-size: 8px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; conf.decoder.initialBufferSize(),</font></div><div style="font-size: 8px;"><font style="font-size: 8px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; conf.minCompressionSize,</font></div><div style="font-size: 8px;"><font style="font-size: 8px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; compressPredicate(conf.compressPredicate, conf.minCompressionSize),</font></div><div style="font-size: 8px;"><font style="font-size: 8px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; conf.forwarded,</font></div><div style="font-size: 8px;"><font style="font-size: 8px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; conf.cookieEncoder,</font></div><div style="font-size: 8px;"><font style="font-size: 8px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; conf.cookieDecoder));</font></div><div style="font-size: 8px;"><font color="#007fff" style="font-size: 8px;">注册处理器</font></div>" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;fillColor=#dae8fc;strokeColor=#6c8ebf;arcSize=4;align=left;" parent="1" vertex="1">
<mxGeometry x="3338.75" y="1851" width="220.5" height="140" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-101" value="<div style="">b.childHandler(updateConfiguration(</div><div style="">b.config().childHandler(), name, c));</div>" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;fillColor=#d5e8d4;strokeColor=#82b366;arcSize=13;align=center;" parent="1" vertex="1">
<mxGeometry x="3640" y="1891" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-106" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="ALvgZmMKo5qc2uUOR07o-103" target="ALvgZmMKo5qc2uUOR07o-105" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-103" value="判断是否需要支持SSL, 是的话<br>SslProvider.setBootstrap(b, ssl);" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;" parent="1" vertex="1">
<mxGeometry x="3199.25" y="2250" width="160" height="60" as="geometry" />
</mxCell>
<mxCell id="ALvgZmMKo5qc2uUOR07o-105" value="return Mono.create(sink -&gt; {...})" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;fillColor=#ffe6cc;strokeColor=#d79b00;" parent="1" vertex="1">
<mxGeometry x="3199.25" y="2330" width="160" height="60" as="geometry" />
</mxCell>
<mxCell id="0TajKGxzIfMUDPpfPPpd-4" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="0TajKGxzIfMUDPpfPPpd-1" target="0TajKGxzIfMUDPpfPPpd-3" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="0TajKGxzIfMUDPpfPPpd-1" value="<div>block(timeout)</div><div><font color="#007fff">阻塞等待bind操作完成</font></div>" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="2800" y="2400" width="160" height="60" as="geometry" />
</mxCell>
<mxCell id="0TajKGxzIfMUDPpfPPpd-6" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="0TajKGxzIfMUDPpfPPpd-3" target="0TajKGxzIfMUDPpfPPpd-5" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="0TajKGxzIfMUDPpfPPpd-3" value="<div>BlockingMonoSubscriber&lt;T&gt; subscriber = new BlockingMonoSubscriber();</div>" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;fillColor=#ffe6cc;strokeColor=#d79b00;" parent="1" vertex="1">
<mxGeometry x="2999.5" y="2400" width="160" height="60" as="geometry" />
</mxCell>
<mxCell id="0TajKGxzIfMUDPpfPPpd-9" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="0TajKGxzIfMUDPpfPPpd-5" target="0TajKGxzIfMUDPpfPPpd-8" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="0TajKGxzIfMUDPpfPPpd-5" value="<div>this.<b>subscribe</b>(</div><div>(Subscriber)subscriber);</div>" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;" parent="1" vertex="1">
<mxGeometry x="2999.5" y="2480" width="160" height="60" as="geometry" />
</mxCell>
<mxCell id="0TajKGxzIfMUDPpfPPpd-7" value="Mono" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1">
<mxGeometry x="3054.5" y="2370" width="50" height="30" as="geometry" />
</mxCell>
<mxCell id="0TajKGxzIfMUDPpfPPpd-8" value="return subscriber.blockingGet(<br>timeout.toMillis(), TimeUnit.MILLISECONDS);" style="whiteSpace=wrap;html=1;fontSize=10;rounded=1;" parent="1" vertex="1">
<mxGeometry x="2999.5" y="2560" width="160" height="60" as="geometry" />
</mxCell>
<mxCell id="0TajKGxzIfMUDPpfPPpd-10" value="return ServerManager.getWebServer(<br>serverManager);" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="1679.5" y="1750" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="0TajKGxzIfMUDPpfPPpd-12" value="<font color="#007fff"><b>这里用到了 ProjectReactor <br>MonoCreate 发布者<br>BlockingMonoSubscriber 订阅者<br>用于阻塞等待Bind操作完成<br></b><br>代码提取到单元测试了,参考:<br>java-async/async-reactive/<br>BlockingMonoSubscriberTest#<br>testWebFluxBindMono()<br></font>" style="text;html=1;align=left;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1">
<mxGeometry x="2599.5" y="1995" width="210" height="140" as="geometry" />
</mxCell>
<mxCell id="u_z_PSljN5TfgaHLhyht-4" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="u_z_PSljN5TfgaHLhyht-1" target="u_z_PSljN5TfgaHLhyht-3" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="u_z_PSljN5TfgaHLhyht-1" value="<div style=""><font size="1">startDaemonAwaitThread(<br>this.disposableServer);</font></div><div style=""><font color="#007fff"><font size="1">启动一个<b>非守护线程</b>阻塞等待<br>Netty服务器(HttpServer)</font><span style="font-size: x-small; background-color: initial;">关闭回调dispose()</span></font></div>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="2161" y="2119" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="u_z_PSljN5TfgaHLhyht-3" value="<div style=""><font size="1">disposableServer<br>.onDispose().block();</font><br></div>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="2399.5" y="2119" width="160.5" height="60" as="geometry" />
</mxCell>
<mxCell id="u_z_PSljN5TfgaHLhyht-5" value="注册 SpringBoot 应用关闭的钩子<br><font color="#007fff">参考其他流程图</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="1081" y="880" width="160" height="60" as="geometry" />
</mxCell>
<mxCell id="u_z_PSljN5TfgaHLhyht-7" value="HttpTrafficHandler" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1">
<mxGeometry x="480" y="1810" width="120" height="30" as="geometry" />
</mxCell>
<mxCell id="u_z_PSljN5TfgaHLhyht-11" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="u_z_PSljN5TfgaHLhyht-8" target="u_z_PSljN5TfgaHLhyht-10" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="u_z_PSljN5TfgaHLhyht-8" value="通过 HAProxyMessageReader 获取请求来源地址,没有就从channel获取" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="680" y="1840" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="u_z_PSljN5TfgaHLhyht-13" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="u_z_PSljN5TfgaHLhyht-10" target="u_z_PSljN5TfgaHLhyht-12" edge="1">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="900" y="1981" />
<mxPoint x="900" y="1931" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="u_z_PSljN5TfgaHLhyht-21" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="u_z_PSljN5TfgaHLhyht-10" target="u_z_PSljN5TfgaHLhyht-18" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="u_z_PSljN5TfgaHLhyht-10" value="支持两种请求协议(格式)" style="rounded=1;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="680" y="1951" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="u_z_PSljN5TfgaHLhyht-24" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="u_z_PSljN5TfgaHLhyht-12" target="u_z_PSljN5TfgaHLhyht-23" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="u_z_PSljN5TfgaHLhyht-12" value="HttpRequest<br><font color="#007fff">HTTP,支持长连接、异步响应</font>" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="920" y="1901" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="u_z_PSljN5TfgaHLhyht-18" value="<font style="font-size: 10px;">DecoderResultProvider<br><font color="#007fff">自定义协议</font><br></font>" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" parent="1" vertex="1">
<mxGeometry x="920" y="2000" width="120" height="60" as="geometry" />
</mxCell>
<mxCell id="u_z_PSljN5TfgaHLhyht-22" value="<div style="text-align: center; font-size: 10px;"><div><font color="#000000"><b>HttpTrafficHandler</b> extends ChannelDuplexHandler&nbsp;<span style="background-color: initial;">implements Runnable, ChannelFutureListener</span></font></div></div><hr style="font-size: 10px;" size="1"><font style="font-size: 10px;">&nbsp;请求处理器</font><p style="margin: 0px 0px 0px 4px; font-size: 10px;"><font style="font-size: 10px;" color="#000000"><br></font></p><p style="margin: 0px 0px 0px 4px;"><font color="#000000">final ConnectionObserver&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;listener;</font></p><p style="margin: 0px 0px 0px 4px;"><span style="font-size: 10px;">//是否是SSL请求</span></p><p style="margin: 0px 0px 0px 4px;"><span style="font-size: 10px;"><font color="#000000">Boolean&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; secure;</font></span></p><p style="margin: 0px 0px 0px 4px;"><span style="font-size: 10px;"><font color="#000000">InetSocketAddress&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; remoteAddress;</font></span></p><p style="margin: 0px 0px 0px 4px;"><span style="font-size: 10px;"><font color="#000000">final boolean&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; readForwardHeaders;</font></span></p><p style="margin: 0px 0px 0px 4px;"><span style="font-size: 10px;"><font color="#000000">final BiPredicate&lt;HttpServerRequest, HttpServerResponse&gt; compress;</font></span></p><p style="margin: 0px 0px 0px 4px;"><span style="font-size: 10px;"><font color="#000000">final ServerCookieEncoder&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cookieEncoder;</font></span></p><p style="margin: 0px 0px 0px 4px;"><span style="font-size: 10px;"><font color="#000000">final ServerCookieDecoder&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cookieDecoder;</font></span></p><p style="margin: 0px 0px 0px 4px;"><span style="font-size: 10px;">//是否是长连接,这里制定true还不算还需要请求头中指定</span></p><p style="margin: 0px 0px 0px 4px;"><span style="font-size: 10px;"><font color="#000000">boolean persistentConnection = true;</font></span></p><p style="margin: 0px 0px 0px 4px;"><span style="font-size: 10px;">//待返回响应的数量</span></p><p style="margin: 0px 0px 0px 4px;"><span style="font-size: 10px;"><font color="#000000">int pendingResponses;</font></span></p><p style="margin: 0px 0px 0px 4px;"><span style="font-size: 10px;"><font color="#000000">Queue&lt;Object&gt; pipelined;</font></span></p><p style="margin: 0px 0px 0px 4px;"><span style="font-size: 10px;"><font color="#000000">ChannelHandlerContext ctx;</font></span></p><p style="margin: 0px 0px 0px 4px;"><span style="font-size: 10px;"><font color="#000000">boolean overflow;</font></span></p><p style="margin: 0px 0px 0px 4px;"><span style="font-size: 10px;"><font color="#000000">boolean nonInformationalResponse;</font></span></p>" style="verticalAlign=top;align=left;overflow=fill;fontSize=12;fontFamily=Helvetica;html=1;fontColor=#007FFF;" parent="1" vertex="1">
<mxGeometry x="-520" y="2000" width="480" height="320" as="geometry" />
</mxCell>
<mxCell id="u_z_PSljN5TfgaHLhyht-26" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="u_z_PSljN5TfgaHLhyht-23" target="u_z_PSljN5TfgaHLhyht-25" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="u_z_PSljN5TfgaHLhyht-23" value="更新状态:是否是长连接、待响应请求数量、是否溢出(待响应数量超过1就是溢出)" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="1080" y="1901" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="u_z_PSljN5TfgaHLhyht-28" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="u_z_PSljN5TfgaHLhyht-25" target="u_z_PSljN5TfgaHLhyht-27" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="u_z_PSljN5TfgaHLhyht-25" value="DecoderResult decoderResult = request.decoderResult();<br><font color="#007fff">即使用Http解码器读取请求内容</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="1080" y="1980" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="u_z_PSljN5TfgaHLhyht-30" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="u_z_PSljN5TfgaHLhyht-27" target="u_z_PSljN5TfgaHLhyht-29" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="u_z_PSljN5TfgaHLhyht-32" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="u_z_PSljN5TfgaHLhyht-27" target="u_z_PSljN5TfgaHLhyht-31" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="u_z_PSljN5TfgaHLhyht-27" value="HttpServerOperations ops = new <b>HttpServerOperations</b>(...);<br>ops.<b>bind</b>();<br><font color="#007fff">本质是连接,封装了HttpTrafficHandler的属性</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="1080" y="2060" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="u_z_PSljN5TfgaHLhyht-34" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="u_z_PSljN5TfgaHLhyht-29" target="u_z_PSljN5TfgaHLhyht-33" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="u_z_PSljN5TfgaHLhyht-29" value="listener.onStateChange(ops, ConnectionObserver.State.<b>CONFIGURED</b>);<br><font color="#007fff">调用 TcpServerBind$ChildObserver 监听方法</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="1080" y="2139.5" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="u_z_PSljN5TfgaHLhyht-43" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;fillColor=#d5e8d4;strokeColor=#82b366;" parent="1" source="u_z_PSljN5TfgaHLhyht-31" target="u_z_PSljN5TfgaHLhyht-41" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="u_z_PSljN5TfgaHLhyht-31" value="<div>channel().<b>attr</b>(<br>ReactorNetty.CONNECTION)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.set(this);<span style=""></span></div><div><font color="#007fff">bind仅仅是将当前ops添加到属性,便于后面取</font></div>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="1320" y="2060" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="u_z_PSljN5TfgaHLhyht-36" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="u_z_PSljN5TfgaHLhyht-33" target="u_z_PSljN5TfgaHLhyht-35" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="u_z_PSljN5TfgaHLhyht-33" value="ctx.fireChannelRead(msg);<br><font color="#007fff">交给pipeline中handler责任链下一个节点处理<br>即 ChannelOperationsHandler<br></font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
<mxGeometry x="1080" y="2220" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="u_z_PSljN5TfgaHLhyht-39" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="u_z_PSljN5TfgaHLhyht-35" target="u_z_PSljN5TfgaHLhyht-38" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="u_z_PSljN5TfgaHLhyht-35" value="invokeChannelRead(findContextInbound(<br>MASK_CHANNEL_READ), msg);" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="1320" y="2220" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="u_z_PSljN5TfgaHLhyht-37" value="<font color="#007fff">此时Pipeline中的默认的处理器链表:<br></font><div><font color="#007fff">pipeline = {DefaultChannelPipeline@6923}&nbsp;</font></div><div><font color="#007fff">&nbsp;head = {<b>DefaultChannelPipeline$HeadContext</b>@6922}&nbsp;</font></div><div><font color="#007fff">&nbsp; next = {DefaultChannelHandlerContext@6918}&nbsp;</font></div><div><font color="#007fff">&nbsp; &nbsp;handler = {<b>HttpServerCodec</b>@6921}&nbsp;</font></div><div><font color="#007fff">&nbsp; &nbsp;next = {DefaultChannelHandlerContext@6916}</font></div><div><font color="#007fff">&nbsp; &nbsp; handler = {<b>HttpTrafficHandler</b>@6915}&nbsp;</font></div><div><font color="#007fff">&nbsp; &nbsp; next = {DefaultChannelHandlerContext@6929}</font></div><div><font color="#007fff">&nbsp; &nbsp; &nbsp;handler = {<b>ChannelOperationsHandler</b>@6964}&nbsp;</font></div><div><font color="#007fff">&nbsp; &nbsp; &nbsp;next = {<b>DefaultChannelPipeline$TailContext</b>@6930}</font></div><div><font color="#007fff">&nbsp; &nbsp; &nbsp; next = null</font></div><div><font color="#007fff"><br></font></div><div><font color="#007fff">即 <b>HttpServerCodec</b>&nbsp;&lt;-&gt; <b>HttpTrafficHandler</b>&nbsp;&lt;-&gt; <b>ChannelOperationsHandler</b></font></div>" style="text;html=1;align=left;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1">
<mxGeometry x="240" y="1946" width="450" height="200" as="geometry" />
</mxCell>
<mxCell id="u_z_PSljN5TfgaHLhyht-42" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="u_z_PSljN5TfgaHLhyht-38" target="u_z_PSljN5TfgaHLhyht-41" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="u_z_PSljN5TfgaHLhyht-38" value="<b>channelRead</b>(ChannelHandlerContext ctx, Object msg)" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fillColor=#fff2cc;strokeColor=#d6b656;" parent="1" vertex="1">
<mxGeometry x="1560" y="2220" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="u_z_PSljN5TfgaHLhyht-40" value="ChannelOperationsHandler" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1">
<mxGeometry x="1575" y="2190" width="170" height="30" as="geometry" />
</mxCell>
<mxCell id="u_z_PSljN5TfgaHLhyht-45" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="u_z_PSljN5TfgaHLhyht-41" target="u_z_PSljN5TfgaHLhyht-44" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="u_z_PSljN5TfgaHLhyht-41" value="ChannelOperations&lt;?, ?&gt; ops = ChannelOperations.get(ctx.channel());" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="1800" y="2220" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="u_z_PSljN5TfgaHLhyht-47" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="u_z_PSljN5TfgaHLhyht-44" target="u_z_PSljN5TfgaHLhyht-46" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="u_z_PSljN5TfgaHLhyht-44" value="ops.<b>onInboundNext</b>(ctx, msg);" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="1800" y="2300" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="u_z_PSljN5TfgaHLhyht-49" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="u_z_PSljN5TfgaHLhyht-46" target="u_z_PSljN5TfgaHLhyht-48" edge="1">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="u_z_PSljN5TfgaHLhyht-46" value="listener().onStateChange(this, HttpServerState.REQUEST_RECEIVED);" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;" parent="1" vertex="1">
<mxGeometry x="2040" y="2300" width="200" height="60" as="geometry" />
</mxCell>
<mxCell id="u_z_PSljN5TfgaHLhyht-51" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="u_z_PSljN5TfgaHLhyht-48" target="u_z_PSljN5TfgaHLhyht-50" edge="1">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="2260" y="2410" />
<mxPoint x="2260" y="2450" />
<mxPoint x="1060" y="2450" />