/** * Adds an alternative way to search for factory implementations. {@link FactoryRegistry} has * a default mechanism bundled in it, which uses the content of all {@code META-INF/services} * directories found on the classpath. This {@code addFactoryIteratorProvider} method allows * to specify additional discovery algorithms. It may be useful in the context of some * frameworks that use the <cite>constructor injection</cite> pattern, like the * <a href="http://www.springframework.org/">Spring framework</a>. */ public static void addFactoryIteratorProvider(final FactoryIteratorProvider provider) { Factories.addFactoryIteratorProvider(provider); }
/** * Removes a provider that was previously {@linkplain #addFactoryIteratorProvider added}. * Note that factories already obtained from the specified provider will not be * {@linkplain FactoryRegistry#deregisterServiceProvider deregistered} by this method. */ public static void removeFactoryIteratorProvider(final FactoryIteratorProvider provider) { Factories.removeFactoryIteratorProvider(provider); }
final FactoryIteratorProvider[] fip = Factories.getIteratorProviders(); for (int i=0; i<fip.length; i++) { final Iterator it = fip[i].iterator(category);
globalConfiguration.synchronizeIteratorProviders(); if (newProviders == null) { return;