if (persistenceProviderClassName.equals(Configuration.PROVIDER_CLASS_DEFAULT)) {
persistenceProviderModule = Configuration.PROVIDER_MODULE_DEFAULT;
}
}
PersistenceProvider provider = getProviderByName(pu, persistenceProviderModule);
// if we haven't loaded the provider yet, load it
if (provider == null) {
if (persistenceProviderModule != null) {
final ModuleLoader moduleLoader = Module.getBootModuleLoader();
Module module = null;
try {
module = moduleLoader.loadModule(ModuleIdentifier.fromString(persistenceProviderModule));
} catch (ModuleLoadException e) {
throw new DeploymentUnitProcessingException("persistence provider module load error "
+ persistenceProviderModule + " (class " + persistenceProviderClassName + ")", e);
}
final ServiceLoader<PersistenceProvider> serviceLoader =
module.loadService(PersistenceProvider.class);
if (serviceLoader != null) {
PersistenceProvider persistenceProvider = null;
for (PersistenceProvider provider1 : serviceLoader) {
// persistence provider jar may contain multiple provider service implementations
// use the one that matches
if (persistenceProviderClassName.equals(provider1.getClass().getName())) {
persistenceProvider = provider1;