lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From no...@apache.org
Subject svn commit: r906923 - in /lucene/solr/trunk: CHANGES.txt src/java/org/apache/solr/core/SolrCore.java src/java/org/apache/solr/core/SolrEventListener.java src/java/org/apache/solr/update/UpdateHandler.java
Date Fri, 05 Feb 2010 12:42:38 GMT
Author: noble
Date: Fri Feb  5 12:42:38 2010
New Revision: 906923

URL: http://svn.apache.org/viewvc?rev=906923&view=rev
Log:
SOLR-1727 SolrEventListener should extend NamedListInitializedPlugin

Modified:
    lucene/solr/trunk/CHANGES.txt
    lucene/solr/trunk/src/java/org/apache/solr/core/SolrCore.java
    lucene/solr/trunk/src/java/org/apache/solr/core/SolrEventListener.java
    lucene/solr/trunk/src/java/org/apache/solr/update/UpdateHandler.java

Modified: lucene/solr/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/CHANGES.txt?rev=906923&r1=906922&r2=906923&view=diff
==============================================================================
--- lucene/solr/trunk/CHANGES.txt (original)
+++ lucene/solr/trunk/CHANGES.txt Fri Feb  5 12:42:38 2010
@@ -227,7 +227,9 @@
   
 * SOLR-1696 : Deprecate old <highlighting> syntax and move configuration to HighlightComponent
(noble)
 
-* Upgraded to Lucene 2.9-dev r900226 (koji)
+* Upgraded to Lucene 2.9-dev r900226 (koji)\
+
+* SOLR-1727: SolrEventListener should extend NamedListInitializedPlugin (noble)
   
 Build
 ----------------------

Modified: lucene/solr/trunk/src/java/org/apache/solr/core/SolrCore.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/core/SolrCore.java?rev=906923&r1=906922&r2=906923&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/core/SolrCore.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/core/SolrCore.java Fri Feb  5 12:42:38 2010
@@ -273,12 +273,8 @@
    }
 
   private void initListeners() {
-    List<PluginInfo> l = solrConfig.getPluginInfos(SolrEventListener.class.getName());
-    firstSearcherListeners = new ArrayList<SolrEventListener>();
-    newSearcherListeners = new ArrayList<SolrEventListener>();
-    for (PluginInfo info : l) {
-      SolrEventListener listener = createEventListener(info.className);
-      listener.init(info.initArgs);
+    for (PluginInfo info : solrConfig.getPluginInfos(SolrEventListener.class.getName()))
{
+      SolrEventListener listener = createInitInstance(info, SolrEventListener.class,"Event
Listener",null);      
       String event = info.attributes.get("event");
       if("firstSearcher".equals(event) ){
         firstSearcherListeners.add(listener);
@@ -289,8 +285,8 @@
     }
   }
 
-  List<SolrEventListener> firstSearcherListeners;
-  List<SolrEventListener> newSearcherListeners;
+  final List<SolrEventListener> firstSearcherListeners = new ArrayList<SolrEventListener>();
+  final List<SolrEventListener> newSearcherListeners = new ArrayList<SolrEventListener>();
 
   /**
    * NOTE: this function is not thread safe.  However, it is safe to call within the

Modified: lucene/solr/trunk/src/java/org/apache/solr/core/SolrEventListener.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/core/SolrEventListener.java?rev=906923&r1=906922&r2=906923&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/core/SolrEventListener.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/core/SolrEventListener.java Fri Feb  5 12:42:38
2010
@@ -19,6 +19,7 @@
 
 import org.apache.solr.common.util.NamedList;
 import org.apache.solr.search.SolrIndexSearcher;
+import org.apache.solr.util.plugin.NamedListInitializedPlugin;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -26,10 +27,9 @@
 /**
  * @version $Id$
  */
-public interface SolrEventListener {
+public interface SolrEventListener extends NamedListInitializedPlugin{
   static final Logger log = LoggerFactory.getLogger(SolrCore.class);
 
-  public void init(NamedList args);
 
   public void postCommit();
 
@@ -61,4 +61,4 @@
    */
   public void newSearcher(SolrIndexSearcher newSearcher, SolrIndexSearcher currentSearcher);
 
-}
\ No newline at end of file
+}

Modified: lucene/solr/trunk/src/java/org/apache/solr/update/UpdateHandler.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/update/UpdateHandler.java?rev=906923&r1=906922&r2=906923&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/update/UpdateHandler.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/update/UpdateHandler.java Fri Feb  5 12:42:38
2010
@@ -61,10 +61,9 @@
   private void parseEventListeners() {
     for (PluginInfo pluginInfo : core.getSolrConfig().getPluginInfos(SolrEventListener.class.getName()))
{
       String event = pluginInfo.attributes.get("event");
-      SolrEventListener listener = core.createEventListener(pluginInfo.className);
-      listener.init(pluginInfo.initArgs);
+      SolrEventListener listener = core.createInitInstance(pluginInfo,SolrEventListener.class,"Event
Listener",null);
       if ("postCommit".equals(event)) {
-        commitCallbacks.add(listener);
+        commitCallbacks.add(core.createInitInstance(pluginInfo,SolrEventListener.class,"Event
Listener",null));
         log.info("added SolrEventListener for postCommit: " + listener);
       } else if ("postOptimize".equals(event)) {
         optimizeCallbacks.add(listener);



Mime
View raw message