enforce load all providers before register them
430619
private List<Pair<Id, GuiceSupplier>> getSuppliers() {
        ImmutableList.Builder<Pair<Id, GuiceSupplier>> suppliersBuilder = ImmutableList.builder();
        for (Binding<GuiceRegistration> registrationBinding : injector.findBindingsByType(TypeLiteral.get(GuiceRegistration.class))) {
            Key<?> key = registrationBinding.getProvider().get().key();
            suppliersBuilder.add(newPair(key));
        }
        return suppliersBuilder.build();
    }
1139246
<T> void registerSPIs(final URL pResource, final Class<T> pCategory, final ClassLoader pLoader) {
        Properties classNames = new Properties();

        try {
            classNames.load(pResource.openStream());
        }
        catch (IOException e) {
            throw new ServiceConfigurationError(e);
        }

        if (!classNames.isEmpty()) {
            @SuppressWarnings({"unchecked"})
            CategoryRegistry<T> registry = categoryMap.get(pCategory);

            Set providerClassNames = classNames.keySet();

            for (Object providerClassName : providerClassNames) {
                String className = (String) providerClassName;
                try {
                    @SuppressWarnings({"unchecked"})
                    Class<T> providerClass = (Class<T>) Class.forName(className, true, pLoader);
                    T provider = providerClass.newInstance();
                    registry.register(provider);
                }
                catch (ClassNotFoundException e) {
                    throw new ServiceConfigurationError(e);
                }
                catch (IllegalAccessException e) {
                    throw new ServiceConfigurationError(e);
                }
                catch (InstantiationException e) {
                    throw new ServiceConfigurationError(e);
                }
                catch (IllegalArgumentException e) {
                    throw new ServiceConfigurationError(e);
                }
            }
        }
    }
957259
def __filter_non_working_providers(self):
        '''
        
        '''
        for alias, drivers in six.iteritems(self.opts['providers'].copy()):
            for driver in drivers.copy():
                fun = '{0}.get_configured_provider'.format(driver)
                if fun not in self.clouds:
                    # Mis-configured provider that got removed?
                    log.warning(
                        'The cloud driver, \'%s\', configured under the '
                        '\'%s\' cloud provider alias, could not be loaded. '
                        'Please check your provider configuration files and '
                        'ensure all required dependencies are installed '
                        'for the \'%s\' driver.\n'
                        'In rare cases, this could indicate the \'%s()\' '
                        'function could not be found.\nRemoving \'%s\' from '
                        'the available providers list',
                        driver, alias, driver, fun, driver
                    )
                    self.opts['providers'][alias].pop(driver)

                    if alias not in self.opts['providers']:
                        continue

                    if not self.opts['providers'][alias]:
                        self.opts['providers'].pop(alias)
                    continue

                with salt.utils.context.func_globals_inject(
                    self.clouds[fun],
                    __active_provider_name__=':'.join([alias, driver])
                ):
                    if self.clouds[fun]() is False:
                        log.warning(
                            'The cloud driver, \'%s\', configured under the '
                            '\'%s\' cloud provider alias is not properly '
                            'configured. Removing it from the available '
                            'providers list.', driver, alias
                        )
                        self.opts['providers'][alias].pop(driver)

            if alias not in self.opts['providers']:
                continue

            if not self.opts['providers'][alias]:
                self.opts['providers'].pop(alias)
1300536
public function registerProviders(array $providers = []): self
    {
        foreach ($providers as $provider) {
            $this->registerProvider($provider);
        }

        return $this;
    }
1198432
public function registerConfiguredProviders()
	{
		$manifestPath = $this->basePath() . '/vendor/services.json';

		(new ProviderRepository($this, new Filesystem, $manifestPath))
		            ->load($this->config['app.providers']);
	}
1367050
public function registerProviders()
    {
        if ($this->app->environment() !== 'production')
        {
            $this->app->register(GeneratorsServiceProvider::class);
            $this->app->register(MigrationsGeneratorServiceProvider::class);
        }
    }
1306854
function initialize (provider, configuration) {
  configuration.profile = true
  configuration.passReqToCallback = true

  return new OpenIDStrategy(configuration, verifier)
}
613772
def register(
            self,
            app: 'Quart',
            first_registration: bool,
            *,
            url_prefix: Optional[str]=None,
    ) -> None:
        """"""
        state = self.make_setup_state(app, first_registration, url_prefix=url_prefix)

        if self.has_static_folder:
            state.add_url_rule(
                self.static_url_path + '/<path:filename>',
                view_func=self.send_static_file, endpoint='static',
            )

        for func in self.deferred_functions:
            func(state)
1293073
public function registerConfiguredProviders()
    {
        foreach ([
                     CacheProvider::class,
                     PartProvider::class,
                     SchedulingProvider::class,
                     ViewProvider::class,
                     EventProvider::class,
                     DatabaseProvider::class,
                     LogProvider::class,
                     HttpProvider::class,
                     SocketProvider::class,

                     ExtendProvider::class,
                 ] as $provider) {
            $this->register($provider);
        }
    }
1371485
private function registerDefaultWebLoaders()
    {
        if (function_exists('curl_init')) {
            $this->loaders['https'] = new CurlWebLoader('https://');
            $this->loaders['http']  = new CurlWebLoader('http://');
        } else {
            $this->loaders['https'] = new FileGetContentsWebLoader('https://');
            $this->loaders['http']  = new FileGetContentsWebLoader('http://');
        }
    }
944738
public function registerProviders()
	{
		$providers = $this['config']->get('app.providers');

		foreach ($providers as $provider) {
			$this->providers[$provider] = new $provider($this);
			$this->providers[$provider]->register();
		}
	}
1153466
protected function registerBaseTenantBindings()
    {
        $this->singleton(TenantContract::class, function ($app) {
            return new Tenant(new NullUser(), new NullTenant(), new NullTenant());
        });

        $this->alias(TenantContract::class, 'auth.tenant');
    }
389939
@Override
	public void registerOsgiProviders (Collection<Object> providers) throws FhirConfigurationException {
		if (null == providers) {
			throw new NullPointerException("FHIR Provider list cannot be null");
		}
		try {
			super.registerProviders(providers);
			for (Object provider : providers) {
				log.trace("registered provider. class ["+provider.getClass().getName()+"]");
				this.serverProviders.add(provider);
			}
		} catch (Exception e) {
			log.error("Error registering FHIR Providers", e);
			throw new FhirConfigurationException("Error registering FHIR Providers", e);
		}
	}
502831
public void registerProvider(Object provider) {
		if (provider != null) {
			Collection<Object> providerList = new ArrayList<>(1);
			providerList.add(provider);
			registerProviders(providerList);
		}
	}
658071
private void preloadDynamicCaches() {
        List<CacheService> dynamicCacheServices = CacheRegistry.getInstance().getDynamicCacheServices();
        for (CacheService dynamicCacheService : dynamicCacheServices) {
            if (dynamicCacheService instanceof PreloadableCache) {
                try {
                    PreloadableCache preloadableCache = (PreloadableCache)dynamicCacheService;
                    RegisteredService regServ = preloadableCache.getClass().getAnnotation(RegisteredService.class);
                    Map<String,String> params = new HashMap<>();
                    Parameter[] parameters = regServ.parameters();
                    if (parameters != null) {
                        for (Parameter parameter : parameters) {
                            if (parameter.name().length() > 0)
                                params.put(parameter.name(), parameter.value());
                        }
                    }
                    preloadableCache.initialize(params);
                    preloadableCache.loadCache();
                }
                catch (Exception ex) {
                    logger.severeException("Failed to preload " + dynamicCacheService.getClass(), ex);
                }
            }
            synchronized(allCaches) {
                allCaches.put(dynamicCacheService.getClass().getName(), dynamicCacheService);
            }
        }
    }
831906
private void registerParentProvider(Object o, Configuration parent) {
        Map<Class<?>, Integer> contracts = parent.getContracts(o.getClass());
        if (contracts != null) {
            providers.put(o, contracts);
        } else {
            register(o, AnnotationUtils.getBindingPriority(o.getClass()),
                        ConfigurableImpl.getImplementedContracts(o, new Class<?>[]{}));
        }
    }
175495
private function loadServiceProvider()
    {
        \Tiga\Framework\Facade\Facade::setFacadeContainer($this);

        // Available Provider
        $providers = $this['config']->get('provider');

        $providers = array_unique($providers);

        foreach ($providers as $provider) {
            $instance = new $provider($this);
            $instance->register();
        }

        // Aliases
        $aliases = $this['config']->get('alias');

        $aliases = array_unique($aliases);

        $aliasMapper = \Tonjoo\Almari\AliasMapper::getInstance();

        $aliasMapper->classAlias($aliases);
    }