Cause the scanning by itself is undefined, you can not scan skip not bean types and be spec compliant.
Le 21 juil. 2017 21:26, "John D. Ament" <[email protected]> a écrit : > Errr I'm not sure what you mean. The spec states this "before it reads the > declared annotations" so I'm not sure why you think it needs to have a bean > defining annotation. > > John > > On Fri, Jul 21, 2017 at 3:21 PM Romain Manni-Bucau <[email protected]> > wrote: > > > Hmm, interesting edge case. For me it should be ignored until you make it > > scanned using @Dependent or so. But fear it is quite undefined or > > "interpretable" > > > > Le 21 juil. 2017 21:10, "John D. Ament" <[email protected]> a écrit > : > > > > > I do something really lazy, I have an extension that has this method on > > it: > > > > > > public void findEntities(@Observes @WithAnnotations(Entity.class) > > > ProcessAnnotatedType<?> pat) > > > > > > which just looks for entity classes. They're not going to be CDI > beans, > > > but they are annotated types. Per the spec, > > > https://docs.jboss.org/cdi/api/2.0/javax/enterprise/inject/spi/ > > > ProcessAnnotatedType.html > > > , > > > the event should get fired, even if there are no bean defining > > annotations. > > > > > > Switching beans.xml to use bean-discovery-mode=all fixes it, but I'd > > prefer > > > to not discover these as beans. > > > > > > Using a <beans bean-discovery-mode="all" version="2.0"><trim/></beans> > > does > > > fix it. But either way, my understanding is that PAT is always fired, > for > > > all classes found within a bean archive. > > > > > > John > > > > > >
