I got a "proof of concept" solution working via afterDeploymentValidation (pushed to https://github.com/scottmarlow/wildfly/tree/orm51) that passes the EntityListenerInjectionSupportTestCase test. I have a hack that only allows one concurrent WildFly deployment, which will not be merged as is.
AfterBeanDiscovery and connecting JPA "state" to extension - yes, I understand; the other question how to implement this properly for more complicated use cases: multiple persistence units are used, EAR deployment, etc.
I can eliminate the hack if there is a way to connect the afterDeploymentValidation extension callback with the JPA deployment state. Not sure if it helps but we do have a BeanManager associated with the deployment and a BeanManager associated with the (WildFly) JPA container/deployer jar. |