incubator-kato-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From monte...@apache.org
Subject svn commit: r791871 - /incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/KatoReader.java
Date Tue, 07 Jul 2009 15:40:00 GMT
Author: monteith
Date: Tue Jul  7 15:40:00 2009
New Revision: 791871

URL: http://svn.apache.org/viewvc?rev=791871&view=rev
Log:
Make KatoReader use ImageFactory registry.

Modified:
    incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/KatoReader.java

Modified: incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/KatoReader.java
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/KatoReader.java?rev=791871&r1=791870&r2=791871&view=diff
==============================================================================
--- incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/KatoReader.java
(original)
+++ incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jdi/src/main/java/org/apache/kato/tools/jdi/KatoReader.java
Tue Jul  7 15:40:00 2009
@@ -22,12 +22,12 @@
 import java.util.List;
 import java.util.Vector;
 
+import org.apache.kato.FactoryRegistry;
 import org.apache.kato.image.CorruptData;
 import org.apache.kato.image.CorruptDataException;
 import org.apache.kato.image.DataUnavailable;
 import org.apache.kato.image.Image;
 import org.apache.kato.image.ImageAddressSpace;
-import org.apache.kato.image.ImageFactory;
 import org.apache.kato.image.ImageProcess;
 import org.apache.kato.image.KatoException;
 import org.apache.kato.image.MemoryAccessException;
@@ -401,25 +401,10 @@
 
 		File f = new File(pathToCore);
 		try {
-			// FIXME Fill in appropriate means of finding an ImageFactory.
-			Class factoryClass = Class.forName("org.example.image.ImageFactory"); //$NON-NLS-1$
-			ImageFactory factory = (ImageFactory) factoryClass.newInstance();
-			image = factory.getImage(f);			
-		} catch (ClassNotFoundException e) {
-			logr.logError(JDILogger.LEVEL_QUIET, "Could not find DTFJ factory class"); //$NON-NLS-1$
-			e.printStackTrace(new PrintStream(logr.getErrorStream()));
-			errorCode = 1;
-			throw e;
-		} catch (IllegalAccessException e) {
-			logr.logError(JDILogger.LEVEL_QUIET, "IllegalAccessException for DTFJ factory class");
//$NON-NLS-1$
-			e.printStackTrace(new PrintStream(logr.getErrorStream()));
-			errorCode = 2;
-			throw e;
-		} catch (InstantiationException e) {
-			logr.logError(JDILogger.LEVEL_QUIET, "Could not instantiate DTFJ factory class"); //$NON-NLS-1$
-			e.printStackTrace(new PrintStream(logr.getErrorStream()));
-			errorCode = 3;
-			throw e;
+			FactoryRegistry registry=null;
+			registry=FactoryRegistry.getDefaultRegistry();			
+			
+			image =  registry.getImage(f);
 		} catch (IOException e) {
 			logr.logError(JDILogger.LEVEL_QUIET, "Could not find/use required file(s)"); //$NON-NLS-1$
 			e.printStackTrace(new PrintStream(logr.getErrorStream()));



Mime
View raw message