-
1. Re: Should an observer method's parameters show up in its bean's injection points?
tremes Feb 27, 2017 1:45 AM (in response to ljnelson)Hi Laird,
Yes I think you should get all injection points including injection points for producer, disposer and observer method. This could be a bug. I will try later today.
-
2. Re: Should an observer method's parameters show up in its bean's injection points?
mkouba Feb 27, 2017 2:46 AM (in response to ljnelson)Hi guys,
I don't think that Bean.getInjectionPoints() should return the injection points declared on observer, producer and disposer methods. First of all, Bean.getInjectionPoints() should only return injection points that do belong to a specific bean. A producer method itself defines a bean, so all the paremeter injection points of a producer should be returned from the Bean represented by this producer. As for disposer and observer methods - these have a special lifecycle. See for example:
5.2.2. Unsatisfied and ambiguous dependencies:
"The container must validate all injection points of all enabled beans, all observer methods and all disposer methods when the application is initialized to ensure that there are no unsatisfied or unresolvable ambiguous dependencies."
6.5.7. Injectable reference validity:
"A reference to a bean injected into a disposer method or observer method is only valid until the invocation of the method completes."
6.4.2. Destruction of objects with scope @Dependent:
"All @Dependent scoped contextual instances injected into method parameters of a disposer method or an observer method are destroyed when the invocation completes".