You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by "Hoss Man (JIRA)" <ji...@apache.org> on 2007/07/03 09:21:04 UTC

[jira] Commented: (SOLR-260) reusable PluginLoader -- helper class to load plugins

    [ https://issues.apache.org/jira/browse/SOLR-260?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12509766 ] 

Hoss Man commented on SOLR-260:
-------------------------------

Ryan ... sorry i slacked off on reviewing the last few patches in this issue.  i just took a look at commit #552680 and it looks sweet.  I'm still not crazy about the "init(T plugin, Map<String, String> params, Node node)" method sig, but since we have to get the class/name params anyway, i guess it doesn't do any harm to pass the Map in along with the Node ... we just need to beef up the javadocs so it's clear where the Map comes from

Just to clarify, if i'm understanding the default="true" code, it means that RequestHandler resolution will go as follows...
 1) look for a RequestHandler with a name matching the request
 2) look for a RequestHandler configured with default="true"
 3) look for a RequestHandler configured with name="standard"
 4) use an anonymous instance of StandardRequestHandler

...that looks good to me, but we should definitely document it.

Minor Question: isn't the init method in the AbstractPluginLoader<SolrRequestHandler> redundant?


> reusable PluginLoader -- helper class to load plugins
> -----------------------------------------------------
>
>                 Key: SOLR-260
>                 URL: https://issues.apache.org/jira/browse/SOLR-260
>             Project: Solr
>          Issue Type: New Feature
>            Reporter: Ryan McKinley
>         Attachments: SOLR-260-PluginLoader.patch, SOLR-260-PluginLoader.patch
>
>
> As we talk about adding more configuration (Handlers, Highlighting, Components, etc) we should standardize the format and share the loading and initialization code.
> This patch extracts the common stuff from SOLR-225 and makes it work with the RequestHandler framework.
> This is an abstract base class -- each implementation needs to take care of actually creating and initializing the instances:
> abstract class PluginLoader<T>
> {
>   abstract public T create( String className, NamedList args, Map<String,String> params );
>  
>   abstract public void init( T plugin, NamedList args, Map<String,String> params );
>   
>   public Map<String,T> load( NodeList nodes )
>   {
>     ...
>   }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.