forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgard...@apache.org
Subject svn commit: r476499 - in /forrest/trunk/whiteboard/forrest2/core/org/apache/forrest/reader: ChainedReader.java FileReader.java HTTPReader.java IReader.java
Date Sat, 18 Nov 2006 12:18:10 GMT
Author: rgardler
Date: Sat Nov 18 04:18:09 2006
New Revision: 476499

URL: http://svn.apache.org/viewvc?view=rev&rev=476499
Log:
Remove reader dependency on Spring - only the Controller implementation should be dependant
on Spring to facilitate the use of other containers

Modified:
    forrest/trunk/whiteboard/forrest2/core/org/apache/forrest/reader/ChainedReader.java
    forrest/trunk/whiteboard/forrest2/core/org/apache/forrest/reader/FileReader.java
    forrest/trunk/whiteboard/forrest2/core/org/apache/forrest/reader/HTTPReader.java
    forrest/trunk/whiteboard/forrest2/core/org/apache/forrest/reader/IReader.java

Modified: forrest/trunk/whiteboard/forrest2/core/org/apache/forrest/reader/ChainedReader.java
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/forrest2/core/org/apache/forrest/reader/ChainedReader.java?view=diff&rev=476499&r1=476498&r2=476499
==============================================================================
--- forrest/trunk/whiteboard/forrest2/core/org/apache/forrest/reader/ChainedReader.java (original)
+++ forrest/trunk/whiteboard/forrest2/core/org/apache/forrest/reader/ChainedReader.java Sat
Nov 18 04:18:09 2006
@@ -20,10 +20,10 @@
 import java.net.URI;
 import java.net.URISyntaxException;
 
+import org.apache.forrest.core.IController;
 import org.apache.forrest.core.document.AbstractSourceDocument;
 import org.apache.forrest.core.document.DefaultSourceDocument;
 import org.apache.forrest.core.locationMap.Location;
-import org.springframework.context.support.AbstractXmlApplicationContext;
 
 /**
  * A chained reader implements a psuedo protocol.
@@ -60,7 +60,7 @@
 
 	private String docType;
 	
-	public AbstractSourceDocument read(AbstractXmlApplicationContext context,
+	public AbstractSourceDocument read(IController controller,
 			final Location location) {
 		DefaultSourceDocument doc = null;
 		final URI psudeoURI = location.getSourceURI();
@@ -70,8 +70,8 @@
 			uri = new URI(ssp);
 			location.setSourceURI(uri);
 			IReader reader;
-			reader = (IReader) context.getBean(uri.getScheme());
-			doc = (DefaultSourceDocument) reader.read(context, location);
+			reader = (IReader) controller.getReader(location);
+			doc = (DefaultSourceDocument) reader.read(controller, location);
 			if (doc != null) {
 				doc
 						.setType(getDocType());

Modified: forrest/trunk/whiteboard/forrest2/core/org/apache/forrest/reader/FileReader.java
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/forrest2/core/org/apache/forrest/reader/FileReader.java?view=diff&rev=476499&r1=476498&r2=476499
==============================================================================
--- forrest/trunk/whiteboard/forrest2/core/org/apache/forrest/reader/FileReader.java (original)
+++ forrest/trunk/whiteboard/forrest2/core/org/apache/forrest/reader/FileReader.java Sat Nov
18 04:18:09 2006
@@ -20,11 +20,11 @@
 import java.io.FileInputStream;
 import java.io.InputStream;
 
+import org.apache.forrest.core.IController;
 import org.apache.forrest.core.document.AbstractSourceDocument;
 import org.apache.forrest.core.document.DocumentFactory;
 import org.apache.forrest.core.exception.SourceException;
 import org.apache.forrest.core.locationMap.Location;
-import org.springframework.context.support.AbstractXmlApplicationContext;
 
 /**
  * An File reader reads a resource using the file protocol, i.e. it will read
@@ -38,7 +38,7 @@
 	 * 
 	 * @see org.apache.forrest.reader.IReader#read(org.apache.forrest.test.core.locationMap.Location)
 	 */
-	public AbstractSourceDocument read(AbstractXmlApplicationContext context, final Location
location) {
+	public AbstractSourceDocument read(IController controller, final Location location) {
 		AbstractSourceDocument result = null;
 		try {
 			final InputStream is = new FileInputStream(new File(location

Modified: forrest/trunk/whiteboard/forrest2/core/org/apache/forrest/reader/HTTPReader.java
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/forrest2/core/org/apache/forrest/reader/HTTPReader.java?view=diff&rev=476499&r1=476498&r2=476499
==============================================================================
--- forrest/trunk/whiteboard/forrest2/core/org/apache/forrest/reader/HTTPReader.java (original)
+++ forrest/trunk/whiteboard/forrest2/core/org/apache/forrest/reader/HTTPReader.java Sat Nov
18 04:18:09 2006
@@ -23,11 +23,11 @@
 import org.apache.commons.httpclient.HttpClient;
 import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
 import org.apache.commons.httpclient.methods.GetMethod;
+import org.apache.forrest.core.IController;
 import org.apache.forrest.core.document.AbstractSourceDocument;
 import org.apache.forrest.core.document.DefaultSourceDocument;
 import org.apache.forrest.core.exception.SourceException;
 import org.apache.forrest.core.locationMap.Location;
-import org.springframework.context.support.AbstractXmlApplicationContext;
 import org.w3c.tidy.Tidy;
 
 /**
@@ -53,7 +53,7 @@
 	 * 
 	 * @see org.apache.forrest.reader.IReader#read(org.apache.forrest.test.core.locationMap.Location)
 	 */
-	public AbstractSourceDocument read(AbstractXmlApplicationContext context, final Location
location)
+	public AbstractSourceDocument read(IController controller, final Location location)
 			throws MalformedURLException {
 		InputStream is;
 		DefaultSourceDocument result = null;

Modified: forrest/trunk/whiteboard/forrest2/core/org/apache/forrest/reader/IReader.java
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/forrest2/core/org/apache/forrest/reader/IReader.java?view=diff&rev=476499&r1=476498&r2=476499
==============================================================================
--- forrest/trunk/whiteboard/forrest2/core/org/apache/forrest/reader/IReader.java (original)
+++ forrest/trunk/whiteboard/forrest2/core/org/apache/forrest/reader/IReader.java Sat Nov
18 04:18:09 2006
@@ -18,9 +18,9 @@
 
 import java.net.MalformedURLException;
 
+import org.apache.forrest.core.IController;
 import org.apache.forrest.core.document.AbstractSourceDocument;
 import org.apache.forrest.core.locationMap.Location;
-import org.springframework.context.support.AbstractXmlApplicationContext;
 
 public interface IReader {
 
@@ -41,7 +41,7 @@
 	 * @return
 	 * @throws MalformedURLException
 	 */
-	public abstract AbstractSourceDocument read(AbstractXmlApplicationContext context, Location
location)
+	public abstract AbstractSourceDocument read(IController controller, Location location)
 			throws MalformedURLException;
 
 }



Mime
View raw message