This repository has been archived by the owner on Sep 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy patheventbrokerspecifications.html
1418 lines (709 loc) · 24.3 KB
/
eventbrokerspecifications.html
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
---
layout: documentation
title: EventBroker
teaser: Decoupled eventing with automatic thread switching
navigation:
- name: Overview
link: eventbroker.html
- name: Tutorial
link: eventbrokertutorial.html
- name: Registration by Attribute
link: eventbrokerregistrationbyattribute.html
- name: Registration over Interface
link: eventbrokerregistrationoverinterface.html
- name: Registration by Registrar
link: eventbrokerregistrationbyregistrar.html
- name: Simplified Handler Methods
link: eventbrokersimplifiedhandlermethods.html
- name: Direct Interaction
link: eventbrokerdirectinteraction.html
- name: Handlers
link: eventbrokerhandlers.html
- name: Matchers
link: eventbrokermatchers.html
- name: Exception Handling
link: eventbrokerexceptionhandling.html
- name: Extensions
link: eventbrokerextensions.html
- name: Logging
link: eventbrokerlogging.html
- name: Testability
link: eventbrokertestability.html
- name: Tips and Tricks
link: eventbrokertipsandtricks.html
- name: Specifications
link: eventbrokerspecifications.html
---
<h2>Appccelerate.EventBroker Specification</h2>
<h2 class="concern">
Clean-up specifications
</h2>
<h3 class="count">
2 contexts, 4 specifications
</h3><h3 class="context">
When subscribers are not reference anymore by client code
</h3>
<h4 class="count">
2 specifications
</h4>
<ul>
<li class="spec"><span id="46">should garbage collect subscribers registered by property</span>
<script type="text/javascript">
function toggleVisibility(id, description) {
var section = document.getElementById(id);
var link = document.getElementById(id + "_link");
if (section.style.display == "block") {
section.style.display = "none";
link.innerHTML = "Show " + description;
} else {
section.style.display = "block";
link.innerHTML = "Hide " + description;
}
};
</script>
</li>
<li class="spec"><span id="47">should garbage collect subscribers registered by registrar</span>
</li>
</ul><h3 class="context">
When the event broker is disposed
</h3>
<h4 class="count">
2 specifications
</h4>
<ul>
<li class="spec"><span id="48">should unregister publishers</span>
</li>
<li class="spec"><span id="49">should unregister registerable publishers</span>
</li>
</ul><h2 class="concern">
Description specifications
</h2>
<h3 class="count">
1 context, 10 specifications
</h3><h3 class="context">
When describing an event broker
</h3>
<h4 class="count">
10 specifications
</h4>
<ul>
<li class="spec"><span id="61">should list all event topics</span>
</li>
<li class="spec"><span id="62">should list all publishers per event topic</span>
</li>
<li class="spec"><span id="63">should list all subscribers per event topic</span>
</li>
<li class="spec"><span id="64">should list event name per publisher</span>
</li>
<li class="spec"><span id="65">should list event handler type per publisher</span>
</li>
<li class="spec"><span id="66">should list matchers per publisher and subscriber</span>
</li>
<li class="spec"><span id="67">should list name of named publishers and subscribers</span>
</li>
<li class="spec"><span id="68">should list handler method per subscriber</span>
</li>
<li class="spec"><span id="69">should list handler type per subscriber</span>
</li>
<li class="spec"><span id="70">should list event args type per subscriber</span>
</li>
</ul><h2 class="concern">
Event registrar specifications
</h2>
<h3 class="count">
10 contexts, 14 specifications
</h3><h3 class="context">
When registering a registerable event publication on the event broker
</h3>
<h4 class="count">
2 specifications
</h4>
<ul>
<li class="spec"><span id="71">should relay fired events to registered subscribers</span>
</li>
<li class="spec"><span id="72">should pass event args to registered subscribers</span>
</li>
</ul><h3 class="context">
When registering an event broker registerable on the event broker
</h3>
<h4 class="count">
1 specification
</h4>
<ul>
<li class="spec"><span id="79">should call register on registerable</span>
</li>
</ul><h3 class="context">
When registering an event with custom event args registerable publication on the event broker
</h3>
<h4 class="count">
2 specifications
</h4>
<ul>
<li class="spec"><span id="73">should relay fired events to registered subscribers</span>
</li>
<li class="spec"><span id="74">should pass event args to registered subscribers</span>
</li>
</ul><h3 class="context">
When registering an registerable event subscription on the event broker
</h3>
<h4 class="count">
2 specifications
</h4>
<ul>
<li class="spec"><span id="75">should relay fired events to added subscription</span>
</li>
<li class="spec"><span id="76">should pass event args to registered subscribers</span>
</li>
</ul><h3 class="context">
When registering an registerable event with custom event args subscriber on the event broker
</h3>
<h4 class="count">
2 specifications
</h4>
<ul>
<li class="spec"><span id="77">should relay fired events to added subscription</span>
</li>
<li class="spec"><span id="78">should pass event args to registered subscribers</span>
</li>
</ul><h3 class="context">
When removing an registerable event subscriber from the event broker
</h3>
<h4 class="count">
1 specification
</h4>
<ul>
<li class="spec"><span id="59">should not relay fired events anymore to subscriber</span>
</li>
</ul><h3 class="context">
When removing an registerable event with custom event args subscriber from the event broker
</h3>
<h4 class="count">
1 specification
</h4>
<ul>
<li class="spec"><span id="60">should not relay fired events anymore to subscriber</span>
</li>
</ul><h3 class="context">
When unregistering a registerable event publisher on the event breoker
</h3>
<h4 class="count">
1 specification
</h4>
<ul>
<li class="spec"><span id="81">should not relay fired events anymore to registered subscribers</span>
</li>
</ul><h3 class="context">
When unregistering a registerable event witch custom event args publisher on the event broker
</h3>
<h4 class="count">
1 specification
</h4>
<ul>
<li class="spec"><span id="82">should not relay fired events anymore to registered subscribers</span>
</li>
</ul><h3 class="context">
When unregistering an event broker registerable on the event broker
</h3>
<h4 class="count">
1 specification
</h4>
<ul>
<li class="spec"><span id="80">should call unregister on registerable</span>
</li>
</ul><h2 class="concern">
Events specifications
</h2>
<h3 class="count">
8 contexts, 10 specifications
</h3><h3 class="context">
When firing an event and subscriber returns result in event args
</h3>
<h4 class="count">
1 specification
</h4>
<ul>
<li class="spec"><span id="54">should return result in event args</span>
</li>
</ul><h3 class="context">
When firing an event belonging to several event topics
</h3>
<h4 class="count">
1 specification
</h4>
<ul>
<li class="spec"><span id="57">should fire all event topics</span>
</li>
</ul><h3 class="context">
When firing an event directly on the event broker
</h3>
<h4 class="count">
1 specification
</h4>
<ul>
<li class="spec"><span id="30">should call subscriber</span>
</li>
</ul><h3 class="context">
When firing an event on a publisher
</h3>
<h4 class="count">
2 specifications
</h4>
<ul>
<li class="spec"><span id="50">should call subscriber</span>
</li>
<li class="spec"><span id="51">should pass event args to subscriber</span>
</li>
</ul><h3 class="context">
When firing an event with custom event args on a publisher
</h3>
<h4 class="count">
2 specifications
</h4>
<ul>
<li class="spec"><span id="52">should call subscriber</span>
</li>
<li class="spec"><span id="53">should pass event args to subscriber</span>
</li>
</ul><h3 class="context">
When firing an event with several subscribers
</h3>
<h4 class="count">
1 specification
</h4>
<ul>
<li class="spec"><span id="55">should call all subscribers</span>
</li>
</ul><h3 class="context">
When firing several publishers with same event topic
</h3>
<h4 class="count">
1 specification
</h4>
<ul>
<li class="spec"><span id="56">should call subscriber every time</span>
</li>
</ul><h3 class="context">
When registering a subscriber handler method belonging to several event topics
</h3>
<h4 class="count">
1 specification
</h4>
<ul>
<li class="spec"><span id="58">should handle all registered event topics</span>
</li>
</ul><h2 class="concern">
Exceptions specifications
</h2>
<h3 class="count">
12 contexts, 13 specifications
</h3><h3 class="context">
When a subscriber throws an exception
</h3>
<h4 class="count">
1 specification
</h4>
<ul>
<li class="spec"><span id="40">should pass exception to publisher</span>
</li>
</ul><h3 class="context">
When a subscriber throws an exception and an extension handles it
</h3>
<h4 class="count">
1 specification
</h4>
<ul>
<li class="spec"><span id="43">should not pass exception to publisher</span>
</li>
</ul><h3 class="context">
When registering a publisher with a static publication event
</h3>
<h4 class="count">
1 specification
</h4>
<ul>
<li class="spec"><span id="4">should throw exception</span>
</li>
</ul><h3 class="context">
When registering a publisher with event args type not matching existing subscription
</h3>
<h4 class="count">
1 specification
</h4>
<ul>
<li class="spec"><span id="8">should throw exception</span>
</li>
</ul><h3 class="context">
When registering a publisher with invalid event signature
</h3>
<h4 class="count">
1 specification
</h4>
<ul>
<li class="spec"><span id="2">should throw exception</span>
</li>
</ul><h3 class="context">
When registering a publisher with multiple publications on same event topic
</h3>
<h4 class="count">
1 specification
</h4>
<ul>
<li class="spec"><span id="1">should throw exception</span>
</li>
</ul><h3 class="context">
When registering a publisher with private publication event
</h3>
<h4 class="count">
1 specification
</h4>
<ul>
<li class="spec"><span id="9">should throw exception</span>
<div class="ignored">
⇐ IGNORED
<ul class="prev-next">
<li class="prev ignored">
</li>
<li class="next ignored">
</li>
</ul>
</div>
</li>
</ul><h3 class="context">
When registering a subscriber with a static subscription handler method
</h3>
<h4 class="count">
1 specification
</h4>
<ul>
<li class="spec"><span id="5">should throw exception</span>
</li>
</ul><h3 class="context">
When registering a subscriber with event args type not matching existing publication
</h3>
<h4 class="count">
1 specification
</h4>
<ul>
<li class="spec"><span id="7">should throw exception</span>
</li>
</ul><h3 class="context">
When registering a subscriber with handler type user interface not on the ui thread
</h3>
<h4 class="count">
1 specification
</h4>
<ul>
<li class="spec"><span id="6">should throw exception</span>
</li>
</ul><h3 class="context">
When registering a subscriber with invalid handler method signature
</h3>
<h4 class="count">
1 specification
</h4>
<ul>
<li class="spec"><span id="3">should throw exception</span>
</li>
</ul><h3 class="context">
When several subscribers throw an exception
</h3>
<h4 class="count">
2 specifications
</h4>
<ul>
<li class="spec"><span id="41">should pass exception to publisher</span>
</li>
<li class="spec"><span id="42">should stop executing subscribers after first exception</span>
</li>
</ul><h2 class="concern">
Extensions specifications
</h2>
<h3 class="count">
6 contexts, 20 specifications
</h3><h3 class="context">
When disposing the event broker and an extension was added on the event broker
</h3>
<h4 class="count">
1 specification
</h4>
<ul>
<li class="spec"><span id="27">should call extension when event topic was disposed</span>
</li>
</ul><h3 class="context">
When events are skipped and an extension was added on the event broker
</h3>
<h4 class="count">
1 specification
</h4>
<ul>
<li class="spec"><span id="28">should call extension when event was skipped</span>
</li>
</ul><h3 class="context">
When firing an event and an extension was added on the event broker
</h3>
<h4 class="count">
4 specifications
</h4>
<ul>
<li class="spec"><span id="23">should call extension when event is fired</span>
</li>
<li class="spec"><span id="24">should call extension when event is relayed</span>
</li>
<li class="spec"><span id="25">should call extension when event was relayed</span>
</li>
<li class="spec"><span id="26">should call extension when event was fired</span>
</li>
</ul><h3 class="context">
When registering objects and an extension was added on the event broker
</h3>
<h4 class="count">
8 specifications
</h4>
<ul>
<li class="spec"><span id="10">should call extension when event topic was created</span>
</li>
<li class="spec"><span id="11">should call extension when publication was created</span>
</li>
<li class="spec"><span id="12">should call extension when subscription was created</span>
</li>
<li class="spec"><span id="13">should call extension when publication was added</span>
</li>
<li class="spec"><span id="14">should call extension when subscription was added</span>
</li>
<li class="spec"><span id="15">should call extension when publisher was processed</span>
</li>
<li class="spec"><span id="16">should call extension when subscriber was processed</span>
</li>
<li class="spec"><span id="17">should call extension when item was registered</span>
</li>
</ul><h3 class="context">
When subscribers throw exceptions and an extension was added on the event broker
</h3>
<h4 class="count">
1 specification
</h4>
<ul>
<li class="spec"><span id="29">should call extension when subscriber throws exception</span>
</li>
</ul><h3 class="context">
When unregistering objects and an extension was added on the event broker
</h3>
<h4 class="count">
5 specifications
</h4>
<ul>
<li class="spec"><span id="18">should call extension when publication was removed</span>
</li>
<li class="spec"><span id="19">should call extension when subscription was removed</span>
</li>
<li class="spec"><span id="20">should call extension when publisher was processed</span>
</li>
<li class="spec"><span id="21">should call extension when subscriber was processed</span>
</li>
<li class="spec"><span id="22">should call extension when item was unregistered</span>
</li>
</ul><h2 class="concern">
Handler restriction specifications
</h2>
<h3 class="count">
2 contexts, 2 specifications
</h3><h3 class="context">
When firing an event with handler restriction and a matching subscriber
</h3>
<h4 class="count">
1 specification
</h4>
<ul>
<li class="spec"><span id="31">should call subscriber</span>
</li>
</ul><h3 class="context">
When firing an event with handler restriction and a non matching subscriber
</h3>
<h4 class="count">
1 specification
</h4>
<ul>
<li class="spec"><span id="32">should throw exception</span>
</li>
</ul><h2 class="concern">
Interface registration specifications
</h2>
<h3 class="count">
1 context, 1 specification
</h3><h3 class="context">
When registering objects with publications or subscriptions on interface
</h3>
<h4 class="count">
1 specification
</h4>
<ul>
<li class="spec"><span id="33">should call subscriber</span>
</li>
</ul><h2 class="concern">
Matchers specifications
</h2>
<h3 class="count">
4 contexts, 6 specifications
</h3><h3 class="context">
When firing an event
</h3>
<h4 class="count">
2 specifications
</h4>
<ul>
<li class="spec"><span id="44">should call subscriber method with matching subscriber matcher</span>