Made the track serializable.
[utils] / crawler / basic / src / org / wamblee / crawler / impl / ConfigurationParser.java
index 679348517ead6824b354dfa7198307fcbe6dee16..7e15d4a3ae90c151a371f98214f48c3a78caf2ca 100644 (file)
@@ -17,7 +17,6 @@
 package org.wamblee.crawler.impl;
 
 import java.io.InputStream;
-import java.io.PrintStream;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
@@ -31,6 +30,7 @@ import org.wamblee.crawler.Configuration;
 import org.wamblee.crawler.GetPageRequest;
 import org.wamblee.crawler.PageRequest;
 import org.wamblee.crawler.PostPageRequest;
+import org.wamblee.xml.XslTransformer;
 
 /**
  * Parsing of the configuration from an XML file.
@@ -60,16 +60,14 @@ public class ConfigurationParser {
     private static final int MAX_TRIES = 3;
 
     private static final int MAX_DELAY = 100;
-
-    private PrintStream _os;
     
+    private XslTransformer _transformer;
+
     /**
      * Constructs the configuration parser. 
-     * @param aOs The stream for logging requests.
-     * TODO plain java logging should be used instead of this awkward mechanism. 
      */
-    public ConfigurationParser(PrintStream aOs) {
-        _os = aOs;
+    public ConfigurationParser(XslTransformer aTransformer) {
+        _transformer = aTransformer; 
     }
 
     /**
@@ -162,10 +160,10 @@ public class ConfigurationParser {
         PageRequest request;
         if (METHOD_POST.equals(method)) {
             request = new PostPageRequest(MAX_TRIES, MAX_DELAY, paramsArray,
-                    xslt);
+                    xslt, _transformer);
         } else if (METHOD_GET.equals(method) || method == null) {
             request = new GetPageRequest(MAX_TRIES, MAX_DELAY, paramsArray,
-                    xslt);
+                    xslt, _transformer);
         } else {
             throw new RuntimeException("Unknown request method '" + method
                     + "'. Only " + METHOD_GET + " and " + METHOD_POST