<div dir="ltr"><div><div>This section (<a href="http://docs.jboss.org/cdi/spec/2.0-PFD/cdi-spec.html#init_events">http://docs.jboss.org/cdi/spec/2.0-PFD/cdi-spec.html#init_events</a>) says: &quot;If other beans [other than the <font face="monospace">BeanManager</font>] are injected into an [portable] extension’s observer methods, non-portable behavior results.&quot;</div></div><div><br></div><div>Rephrased: a portable extension&#39;s observer methods must have a minimum of one parameter (the event being observed) and a maximum of two parameters (that plus the <font face="monospace">BeanManager</font>), and none other if you want to stay truly portable.</div><div><br></div><div>For true container lifecycle events, I understand this (you don&#39;t have beans to inject yet).  But given that a bean must be provided by the container for a portable extension (<a href="http://docs.jboss.org/cdi/spec/2.0-PFD/cdi-spec.html#init_events">http://docs.jboss.org/cdi/spec/2.0-PFD/cdi-spec.html#init_events</a>), wouldn&#39;t it be reasonable to permit extra injection points in a portable extension&#39;s <i>non</i>-container-lifecycle-event-observing observer methods?</div><div><br></div><div>Concretely, I&#39;d like to do this:</div><div><br></div><div><font face="monospace">  // In my portable extension</font></div><div><font face="monospace">  private static final void doSomethingAtStartup(@Observes @Initialized(ApplicationScoped.class) final Object event, final Frobnicator someBean) {</font></div><div><font face="monospace">    someBean.doSomething();</font></div><div><font face="monospace">  }</font></div><div><br></div><div>...but that would seem to be in violation of the specification.  Could someone kindly explain why?</div><div><br></div><div>Thanks,</div><div>Best,</div><div>Laird</div></div>