It is created at the EMF level, as a ValidatorFactory can only be passed in on a createEMF() or createContainerEMF() call as a Map property, or by trying to create a default validator off the classpath if none were supplied.
A little background - The ValidatingLifecycleEventManager (VLEM) was created as part of
OPENJPA-1068 as a way to extend the existing LifecycleEventManager (LEM) with Bean Validation (BV) specific behavior.
Previously, the LEM was created by BrokerImpl.initialize(), but we couldn't put the VLEM vs. LEM logic there, as BrokerImpl is in openjpa-kernel and doesn't have access to any of the JPA Spec APIs. We also couldn't place the logic in OpenJPAConfigurationImpl, as that class is also in openjpa-kernel and can't access the JPA Spec APIs. So, we followed Albert's coding for LockMgr and used the PersistenceProductDerivation to setup the configuration objects.
Now, there is still one scenario that doesn't work and will be addressed by
OPENJPA-1111, which may lead us to moving the VLEM vs LEM creation logic to some other location.
Any thoughts on where this logic (which requires access to the javax.persistence.validation spec classes) should reside would be greatly appreciated.