Details
-
Bug
-
Resolution: Won't Do
-
Major
-
None
-
1.0.0.GA, 1.0.1.Final
-
None
Description
Page 71 of the spec states: An event is delivered to an observer method if the observer method has ALL the event qualifiers. (emphasis mine). The behavior of Weld is if all method qualifiers are present on the event then the method will receive the event.
//event injection point
@Inject @Q1 @Q2 Event<Color> colorEvent;
//fire event
colorEvent.fire(Color.BLUE);
//All events have both a Q1 and Q2 qualifier
//only the last method should be called but all four methods are called
public class ColorChangeConsumer {
public void onAnyColorChange(@Observes Color color) {}
public void onQ1ColorChange(@Observes @Q1 Color color) {}
public void onQ2ColorChange(@Observes @Q2 Color color) {}
public void onQ1QQ2ColorChange(@Observes @Q1 @Q2 Color color) {}
}
This behavior is also seen when using Event.select as seen in the docs: http://docs.jboss.org/weld/reference/1.0.1-Final/en-US/html_single/#d0e4194