On Fri, Feb 17, 2017 at 3:37 AM Antoine Sabot-Durand <
antoine(a)sabot-durand.net> wrote:
After discussing and testing with Martin we discovered that having
an
Observer with a payload of type Object and an injected parameter that is
not BeanManager is not supported.
For instance:
void MyObserver(@Observes Object payload, MyBean bean) { ... )
Which makes sense since with observer resolution rules this observer will
be invoked for all Lifecycle events.
Oh, that very specific aspect is an aspect I hadn't considered. That makes
sense.
Your earlier point about how MyBean might not be resolved at invocation
time was one I didn't understand. If I have:
void MyObserver(@Observes @Initialized(ApplicationScoped.class) Object
payload, MyBean bean) { ... }
...then surely MyBean would be resolved at this point, by definition? (I
understand you're looking at this specific case, but even more generally
here: wouldn't MyBean be guaranteed to be resolved here?)
Best,
Laird