Right now, the following observers are forbidden:
void first(@Observes Object foo, Bar bar) { |
} |
void second(@Observes @Foo Object foo, Bar bar) { |
}
|
whereas this one is allowed:
void third(@Observes Foo foo, Bar bar) { |
}
|
Note that the first observer would be notified even for container lifecycle events and so it's considered a container lifecycle event observer. However, the second observer is incorrectly considered a container lifecycle event observer too. Observers.isContainerLifecycleObserverMethod() should return false for an observer with observed type java.lang.Object and a qualifier other than @Any. Note that all the above observers are defined as non-portable in the spec. The problem is that extensions can communicate using events and so the required beans may be not discovered/available yet. However, I think Weld should be consistent here. If third is allowed, the second should be allowed too. |