-
Bug
-
Resolution: Done
-
Minor
-
None
-
None
-
Documentation (Ref Guide, User Guide, etc.)
On page 86 of the Weld reference manual, the following example of event observer behavior is incorrect:
Event qualifier types may be combined, for example:
@Inject @Blog Event<Document> blogEvent; ... if (document.isBlog()) blogEvent.select(new AnnotationLiteral<Updated>(){}).fire(document);Observers must completely match the final qualified type of the event. Assume the following observers in this example:
public void afterBlogUpdate(@Observes @Updated @Blog Document document) { ... } public void afterDocumentUpdate(@Observes @Updated Document document) { ... } public void onAnyBlogEvent(@Observes @Blog Document document) { ... } public void onAnyDocumentEvent(@Observes Document document) { ... }}}The only observer notified will be:
public void afterBlogUpdate(@Observes @Updated @Blog Document document) { ... }