-
Bug
-
Resolution: Won't Do
-
Major
-
None
-
3.0.0.Alpha17
-
None
When a bean is written with an observer method declared like this:
public void onStartup(@Observes @Initialized(ApplicationScoped.class) final Object payload) { }
...the bean is (properly) instantiated per section 5.5.6 of the CDI specification.
If, instead, an equivalent observer method is programmatically added, the bean is not instantiated.
The specification does not seem to distinguish between these two cases, so in my opinion the CDI implementation here (Weld) needs to instantiate the bean when invoking a programmatically-added observer method.
Related forum discussion: https://developer.jboss.org/message/966109