Author: ab
Date: Wed Feb  1 04:59:39 2006
New Revision: 374061

URL: http://svn.apache.org/viewcvs?rev=374061&view=rev
Log:
Apply patches in NUTCH-194.

Modified:
    lucene/nutch/trunk/src/java/org/apache/nutch/plugin/Plugin.java
    lucene/nutch/trunk/src/java/org/apache/nutch/plugin/PluginRepository.java
    lucene/nutch/trunk/src/java/org/apache/nutch/searcher/QueryFilters.java
    lucene/nutch/trunk/src/test/org/apache/nutch/plugin/SimpleTestPlugin.java

Modified: lucene/nutch/trunk/src/java/org/apache/nutch/plugin/Plugin.java
URL: 
http://svn.apache.org/viewcvs/lucene/nutch/trunk/src/java/org/apache/nutch/plugin/Plugin.java?rev=374061&r1=374060&r2=374061&view=diff
==============================================================================
--- lucene/nutch/trunk/src/java/org/apache/nutch/plugin/Plugin.java (original)
+++ lucene/nutch/trunk/src/java/org/apache/nutch/plugin/Plugin.java Wed Feb  1 
04:59:39 2006
@@ -15,6 +15,9 @@
  * limitations under the License.
  */
 package org.apache.nutch.plugin;
+
+import org.apache.nutch.util.NutchConf;
+
 /**
  * A nutch-plugin is an container for a set of custom logic that provide
  * extensions to the nutch core functionality or another plugin that provides 
an
@@ -37,12 +40,15 @@
  */
 public class Plugin {
   private PluginDescriptor fDescriptor;
+  protected NutchConf nutchConf;
+
   /**
    * Constructor
    *  
    */
-  public Plugin(PluginDescriptor pDescriptor) {
+  public Plugin(PluginDescriptor pDescriptor, NutchConf nutchConf) {
     setDescriptor(pDescriptor);
+    this.nutchConf = nutchConf;
   }
   /**
    * Will be invoked until plugin start up. Since the nutch-plugin system use

Modified: 
lucene/nutch/trunk/src/java/org/apache/nutch/plugin/PluginRepository.java
URL: 
http://svn.apache.org/viewcvs/lucene/nutch/trunk/src/java/org/apache/nutch/plugin/PluginRepository.java?rev=374061&r1=374060&r2=374061&view=diff
==============================================================================
--- lucene/nutch/trunk/src/java/org/apache/nutch/plugin/PluginRepository.java 
(original)
+++ lucene/nutch/trunk/src/java/org/apache/nutch/plugin/PluginRepository.java 
Wed Feb  1 04:59:39 2006
@@ -56,6 +56,8 @@
 
     private HashMap fActivatedPlugins;
 
+    private NutchConf nutchConf;
+
     
     public static final Logger LOG = LogFormatter
             .getLogger("org.apache.nutch.plugin.PluginRepository");
@@ -67,6 +69,7 @@
     public PluginRepository(NutchConf nutchConf) throws RuntimeException {
       fActivatedPlugins = new HashMap();
       fExtensionPoints = new HashMap();
+      this.nutchConf = nutchConf;
       this.auto = nutchConf.getBoolean("plugin.auto-activation", true);
       String[] pluginFolders = nutchConf.getStrings("plugin.folders");
       PluginManifestParser manifestParser =  new 
PluginManifestParser(nutchConf, this);
@@ -280,9 +283,9 @@
                 Class pluginClass = loader.loadClass(pDescriptor
                         .getPluginClass());
                 Constructor constructor = pluginClass
-                        .getConstructor(new Class[] { PluginDescriptor.class 
});
+                        .getConstructor(new Class[] { PluginDescriptor.class, 
NutchConf.class });
                 Plugin plugin = (Plugin) constructor
-                        .newInstance(new Object[] { pDescriptor });
+                        .newInstance(new Object[] { pDescriptor, 
this.nutchConf });
                 plugin.startUp();
                 fActivatedPlugins.put(pDescriptor.getPluginId(), plugin);
                 return plugin;

Modified: 
lucene/nutch/trunk/src/java/org/apache/nutch/searcher/QueryFilters.java
URL: 
http://svn.apache.org/viewcvs/lucene/nutch/trunk/src/java/org/apache/nutch/searcher/QueryFilters.java?rev=374061&r1=374060&r2=374061&view=diff
==============================================================================
--- lucene/nutch/trunk/src/java/org/apache/nutch/searcher/QueryFilters.java 
(original)
+++ lucene/nutch/trunk/src/java/org/apache/nutch/searcher/QueryFilters.java Wed 
Feb  1 04:59:39 2006
@@ -58,6 +58,8 @@
         if (point == null)
           throw new RuntimeException(QueryFilter.X_POINT_ID + " not found.");
         Extension[] extensions = point.getExtensions();
+        FIELD_NAMES = new HashSet();
+        RAW_FIELD_NAMES = new HashSet();
         QueryFilter[] filters = new QueryFilter[extensions.length];
         for (int i = 0; i < extensions.length; i++) {
           Extension extension = extensions[i];
@@ -69,11 +71,9 @@
             continue;
           }
           filters[i] = (QueryFilter) extension.getExtensionInstance();
-          FIELD_NAMES = new HashSet();
           FIELD_NAMES.addAll(fieldNames);
           FIELD_NAMES.addAll(rawFieldNames);
           nutchConf.setObject("FIELD_NAMES", FIELD_NAMES);
-          RAW_FIELD_NAMES = new HashSet();
           RAW_FIELD_NAMES.addAll(rawFieldNames);
           nutchConf.setObject("RAW_FIELD_NAMES", RAW_FIELD_NAMES);
         }

Modified: 
lucene/nutch/trunk/src/test/org/apache/nutch/plugin/SimpleTestPlugin.java
URL: 
http://svn.apache.org/viewcvs/lucene/nutch/trunk/src/test/org/apache/nutch/plugin/SimpleTestPlugin.java?rev=374061&r1=374060&r2=374061&view=diff
==============================================================================
--- lucene/nutch/trunk/src/test/org/apache/nutch/plugin/SimpleTestPlugin.java 
(original)
+++ lucene/nutch/trunk/src/test/org/apache/nutch/plugin/SimpleTestPlugin.java 
Wed Feb  1 04:59:39 2006
@@ -17,6 +17,8 @@
 
 package org.apache.nutch.plugin;
 
+import org.apache.nutch.util.NutchConf;
+
 /**
  * Simple Test plugin
  * 
@@ -26,10 +28,11 @@
 
   /**
    * @param pDescriptor 
+   * @param nutchConf 
    */
-  public SimpleTestPlugin(PluginDescriptor pDescriptor) {
+  public SimpleTestPlugin(PluginDescriptor pDescriptor, NutchConf nutchConf) {
 
-    super(pDescriptor);
+    super(pDescriptor, nutchConf);
   }
 
   /*




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Nutch-cvs mailing list
Nutch-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nutch-cvs

Reply via email to