[cdi-dev] CDI-33: Firing ProcessAnnotatedType events for types added by BeforeBeanDiscovery.addAnnotatedType()
Pete Muir
pmuir at redhat.com
Wed Jun 22 07:26:15 EDT 2011
https://issues.jboss.org/browse/CDI-33
Another proposal for review. The spec does not require that a CDI impl fire a PAT event for types added by BBD.addAnnotatedType() -- it explicitly talks about only firing PAT events for types discovered.
This clearly needs fixing for CDI 1.1, and I think it is important to differentiate between types discovered, and types added, not least so that people can restore CDI 1.0 behavior with minimal fuss. I would propose we use polymorphism to provide this, by adding an interface
interface ProcessSyntheticAnnotatedType extends AnnotatedType {
Extension getSource();
}
A ProcessSyntheticAnnotatedType event would be fired for every AnnotatedType added viaBeforeBeanDiscovery.addAnnotatedType(). This event must be fired after BeforeBeanDiscovery and before the container starts creating beans (IOW at the same time other ProcessAnnotatedType events are fired). The getSource method would return the extension instance which called BBD.addAnnotatedType.
WDYT?
Pete
More information about the cdi-dev
mailing list