IIUC y'all are suggesting we implement a javax.enterprise.inject.spi.Extension as outlined in that section overall @ http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#init_events and that we'd specifically hook into the AfterDeploymentValidation event as discussed in the specific section you linked. javax.enterprise.inject.spi.Extension is "discovered" by Java's ServiceLoader. So why are you wondering if CDI would see it? I had looked into an "initialize on first call" approach, but there are some things I was unsure of or did not like:
- The main concern was that really this ought to cause the PU to fail to deploy, but this approach precludes that
- I was not sure we'd have access to the BeanManager, or the proper BeanManager, at first invocation time
|