*/
public class EntityManagerFactoryLookup implements EntityManagerFactoryAccess {
@Override
public EntityManagerFactory entityManagerFactory(final String scopedPersistenceUnitName) {
PersistenceUnitService persistenceUnitService = PersistenceUnitRegistryImpl.INSTANCE.getPersistenceUnitService(scopedPersistenceUnitName);
if (persistenceUnitService == null) {
throw JpaLogger.ROOT_LOGGER.PersistenceUnitNotAvailable(scopedPersistenceUnitName);
}
return persistenceUnitService.getEntityManagerFactory();
}