lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cpoersc...@apache.org
Subject [lucene-solr] branch branch_8x updated: SOLR-13965: Factor out public static StreamHandler.addExpressiblePlugins method.
Date Tue, 21 Jan 2020 18:35:32 GMT
This is an automated email from the ASF dual-hosted git repository.

cpoerschke pushed a commit to branch branch_8x
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/branch_8x by this push:
     new 513d475  SOLR-13965: Factor out public static StreamHandler.addExpressiblePlugins
method.
513d475 is described below

commit 513d4758cd5f55bc3dfeea0fb297ed1bcc7ab3a3
Author: Christine Poerschke <cpoerschke@apache.org>
AuthorDate: Tue Jan 21 18:09:11 2020 +0000

    SOLR-13965: Factor out public static StreamHandler.addExpressiblePlugins method.
---
 .../org/apache/solr/handler/StreamHandler.java     | 26 +++++++++++++---------
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/solr/core/src/java/org/apache/solr/handler/StreamHandler.java b/solr/core/src/java/org/apache/solr/handler/StreamHandler.java
index 9fd6681..a736ca5 100644
--- a/solr/core/src/java/org/apache/solr/handler/StreamHandler.java
+++ b/solr/core/src/java/org/apache/solr/handler/StreamHandler.java
@@ -123,17 +123,7 @@ public class StreamHandler extends RequestHandlerBase implements SolrCoreAware,
     streamFactory.withSolrResourceLoader(core.getResourceLoader());
 
     // This pulls all the overrides and additions from the config
-    List<PluginInfo> pluginInfos = core.getSolrConfig().getPluginInfos(Expressible.class.getName());
-    for (PluginInfo pluginInfo : pluginInfos) {
-      if (pluginInfo.pkgName != null) {
-        ExpressibleHolder holder = new ExpressibleHolder(pluginInfo, core, SolrConfig.classVsSolrPluginInfo.get(Expressible.class));
-        streamFactory.withFunctionName(pluginInfo.name,
-            () -> holder.getClazz());
-      } else {
-        Class<? extends Expressible> clazz = core.getMemClassLoader().findClass(pluginInfo.className,
Expressible.class);
-        streamFactory.withFunctionName(pluginInfo.name, clazz);
-      }
-    }
+    addExpressiblePlugins(streamFactory, core);
 
     core.addCloseHook(new CloseHook() {
       @Override
@@ -148,6 +138,20 @@ public class StreamHandler extends RequestHandlerBase implements SolrCoreAware,
     });
   }
 
+  public static void addExpressiblePlugins(StreamFactory streamFactory, SolrCore core) {
+    List<PluginInfo> pluginInfos = core.getSolrConfig().getPluginInfos(Expressible.class.getName());
+    for (PluginInfo pluginInfo : pluginInfos) {
+      if (pluginInfo.pkgName != null) {
+        ExpressibleHolder holder = new ExpressibleHolder(pluginInfo, core, SolrConfig.classVsSolrPluginInfo.get(Expressible.class));
+        streamFactory.withFunctionName(pluginInfo.name,
+            () -> holder.getClazz());
+      } else {
+        Class<? extends Expressible> clazz = core.getMemClassLoader().findClass(pluginInfo.className,
Expressible.class);
+        streamFactory.withFunctionName(pluginInfo.name, clazz);
+      }
+    }
+  }
+
   public static class ExpressibleHolder extends PackagePluginHolder {
     private Class clazz;
 


Mime
View raw message