]> source.dussan.org Git - pf4j.git/commitdiff
Add helper DefaultExtensionFinder.addServiceProviderExtensionFinder
authorDecebal Suiu <decebal.suiu@gmail.com>
Mon, 28 Mar 2016 16:58:40 +0000 (19:58 +0300)
committerDecebal Suiu <decebal.suiu@gmail.com>
Mon, 28 Mar 2016 16:58:40 +0000 (19:58 +0300)
pf4j/src/main/java/ro/fortsoft/pf4j/DefaultExtensionFinder.java

index fff72a48e411e17f3e16d56fedf80005f3219e07..66fb9523eaad0dfcc014bf17d0ad3a7e5af7f5d2 100644 (file)
@@ -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);