/** * 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>. * * @param provider A new provider for factory iterators. */ public static void addFactoryIteratorProvider(final FactoryIteratorProvider provider) { FactoryIteratorProviders.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#deregisterFactory deregistered} by this method. * * @param provider The provider to remove. */ public static void removeFactoryIteratorProvider(final FactoryIteratorProvider provider) { FactoryIteratorProviders.removeFactoryIteratorProvider(provider); }
globalConfiguration.synchronizeIteratorProviders(); if (newProviders == null) { return;
final FactoryIteratorProvider[] fip = FactoryIteratorProviders.getIteratorProviders(); for (FactoryIteratorProvider aFip : fip) { final Iterator<T> it = aFip.iterator(category);