Browse Source

Add helper DefaultExtensionFinder.addServiceProviderExtensionFinder

pull/94/merge
Decebal Suiu 9 years ago
parent
commit
33706d534c
  1. 9
      pf4j/src/main/java/ro/fortsoft/pf4j/DefaultExtensionFinder.java

9
pf4j/src/main/java/ro/fortsoft/pf4j/DefaultExtensionFinder.java

@ -28,9 +28,14 @@ import java.util.Set;
*/
public class DefaultExtensionFinder implements ExtensionFinder, PluginStateListener {
protected PluginManager pluginManager;
protected List<ExtensionFinder> finders = new ArrayList<>();
public DefaultExtensionFinder(PluginManager pluginManager) {
this.pluginManager = pluginManager;
finders = new ArrayList<>();
addExtensionFinder(new LegacyExtensionFinder(pluginManager));
// addExtensionFinder(new ServiceProviderExtensionFinder(pluginManager));
}
@ -64,6 +69,10 @@ public class DefaultExtensionFinder implements ExtensionFinder, PluginStateListe
}
}
public DefaultExtensionFinder addServiceProviderExtensionFinder() {
return addExtensionFinder(new ServiceProviderExtensionFinder(pluginManager));
}
public DefaultExtensionFinder addExtensionFinder(ExtensionFinder finder) {
finders.add(finder);

Loading…
Cancel
Save