Sha256: 585b6d1f83337abfcbf614c45ecc9c2f9ea855175d14129af6e1609a4bc8f1d8
Contents?: true
Size: 1.03 KB
Versions: 6
Compression:
Stored size: 1.03 KB
Contents
package org.embulk.plugin; import java.util.Set; import java.util.List; import com.google.common.collect.ImmutableList; import com.google.inject.Inject; import com.google.inject.Injector; import org.embulk.config.ConfigException; public class PluginManager { private final List<PluginSource> sources; private final Injector injector; // Set<PluginSource> is injected BuiltinPluginSourceModule or extensions // using Multibinder<PluginSource>. @Inject public PluginManager(Set<PluginSource> pluginSources, Injector injector) { this.sources = ImmutableList.copyOf(pluginSources); this.injector = injector; } public <T> T newPlugin(Class<T> iface, PluginType type) { for (PluginSource source : sources) { try { return source.newPlugin(iface, type); } catch (PluginSourceNotMatchException e) { } } throw new ConfigException("Plugin not found"); // TODO exception message should include type in original format } }
Version data entries
6 entries across 6 versions & 1 rubygems