jpa/subsystem/src/main/java/org/jboss/as/jpa/processor/PersistenceProviderAdaptorLoader.java
public static PersistenceProviderAdaptor loadPersistenceAdapterModule(final String adapterModule, final Platform platform, JtaManagerImpl manager) throws
        ModuleLoadException {
        final ModuleLoader moduleLoader = Module.getBootModuleLoader();

        if (adapterModule == null) {
            return noopAdaptor;
        }

        PersistenceProviderAdaptor persistenceProviderAdaptor=null;

        Module module = moduleLoader.loadModule(ModuleIdentifier.fromString(adapterModule));
        final ServiceLoader<PersistenceProviderAdaptor> serviceLoader =
            module.loadService(PersistenceProviderAdaptor.class);
        if (serviceLoader != null) {
            for (PersistenceProviderAdaptor adaptor : serviceLoader) {
                if (persistenceProviderAdaptor != null) {
                    throw JpaLogger.ROOT_LOGGER.multipleAdapters(adapterModule);
                }
                persistenceProviderAdaptor = adaptor;
                ROOT_LOGGER.debugf("loaded persistence provider adapter %s", adapterModule);
            }
            if (persistenceProviderAdaptor != null) {
                persistenceProviderAdaptor.injectJtaManager(manager);
                persistenceProviderAdaptor.injectPlatform(platform);
            }
        }

        return persistenceProviderAdaptor;
    }
public static PersistenceProviderAdaptor loadPersistenceAdapterModule(final String adapterModule, final Platform platform, JtaManagerImpl manager) throws
        ModuleLoadException {
        final ModuleLoader moduleLoader = Module.getBootModuleLoader();

        if (adapterModule == null) {
            return noopAdaptor;
        }

        PersistenceProviderAdaptor persistenceProviderAdaptor=null;

        Module module = moduleLoader.loadModule(ModuleIdentifier.fromString(adapterModule));
        final ServiceLoader<PersistenceProviderAdaptor> serviceLoader =
            module.loadService(PersistenceProviderAdaptor.class);
        if (serviceLoader != null) {
            for (PersistenceProviderAdaptor adaptor : serviceLoader) {
                if (persistenceProviderAdaptor != null) {
                    throw JpaLogger.ROOT_LOGGER.multipleAdapters(adapterModule);
                }
                persistenceProviderAdaptor = adaptor;
                ROOT_LOGGER.debugf("loaded persistence provider adapter %s", adapterModule);
            }
            if (persistenceProviderAdaptor != null) {
                persistenceProviderAdaptor.injectJtaManager(manager);
                persistenceProviderAdaptor.injectPlatform(platform);
            }
        }

        return persistenceProviderAdaptor;
    }
public static PersistenceProviderAdaptor loadPersistenceAdapterModule ( final String adapterModule , final Platform platform , JtaManagerImpl manager ) throws ModuleLoadException { final ModuleLoader moduleLoader = Module . getBootModuleLoader ( ) ; if ( adapterModule == null ) { return noopAdaptor ; } PersistenceProviderAdaptor persistenceProviderAdaptor = null ; Module module = moduleLoader . loadModule ( ModuleIdentifier . fromString ( adapterModule ) ) ; final ServiceLoader < PersistenceProviderAdaptor > serviceLoader = module . loadService ( PersistenceProviderAdaptor . class ) ; if ( serviceLoader != null ) { for ( PersistenceProviderAdaptor adaptor : serviceLoader ) { if ( persistenceProviderAdaptor != null ) { throw JpaLogger . ROOT_LOGGER . multipleAdapters ( adapterModule ) ; } persistenceProviderAdaptor = adaptor ; ROOT_LOGGER . debugf ( "loaded persistence provider adapter %s" , adapterModule ) ; } if ( persistenceProviderAdaptor != null ) { persistenceProviderAdaptor . injectJtaManager ( manager ) ; persistenceProviderAdaptor . injectPlatform ( platform ) ; } } return persistenceProviderAdaptor ; }
Loads the persistence provider adapter

@param adapterModule may specify the adapter module name (can be null to use noop provider)
@return the persistence provider adaptor for the provider class
@throws ModuleLoadException
Loads the persistence provider adapter