From 33706d534c8f6b7ac6cce62e5dfb205805ae01b4 Mon Sep 17 00:00:00 2001 From: Decebal Suiu Date: Mon, 28 Mar 2016 19:58:40 +0300 Subject: [PATCH] Add helper DefaultExtensionFinder.addServiceProviderExtensionFinder --- .../java/ro/fortsoft/pf4j/DefaultExtensionFinder.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pf4j/src/main/java/ro/fortsoft/pf4j/DefaultExtensionFinder.java b/pf4j/src/main/java/ro/fortsoft/pf4j/DefaultExtensionFinder.java index fff72a4..66fb952 100644 --- a/pf4j/src/main/java/ro/fortsoft/pf4j/DefaultExtensionFinder.java +++ b/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 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); -- 2.39.5