db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r482812 - in /db/derby/code/trunk/java/engine/org/apache/derby/impl/services/reflect: JarFile.java JarFileJava2.java JarLoader.java
Date Tue, 05 Dec 2006 22:39:36 GMT
Author: djd
Date: Tue Dec  5 14:39:35 2006
New Revision: 482812

URL: http://svn.apache.org/viewvc?view=rev&rev=482812
Log:
DERBY-538 (partial) Initial step in cleaning up JarFile/JarFileJava2 as a step to having a
single class since
all environments Derby runs in supports the java.util.Jar package.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/services/reflect/JarFile.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/services/reflect/JarFileJava2.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/services/reflect/JarLoader.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/services/reflect/JarFile.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/services/reflect/JarFile.java?view=diff&rev=482812&r1=482811&r2=482812
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/services/reflect/JarFile.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/services/reflect/JarFile.java Tue
Dec  5 14:39:35 2006
@@ -32,23 +32,22 @@
 import org.apache.derby.iapi.util.IdUtil;
 import org.apache.derby.iapi.services.io.InputStreamUtil;
 
-class JarFile {
+/**
+ * Represents a jar file for class loading,
+ * previously installed by the sqlj.install_jar or replace_jar procedures.
+ * <br>
+ * The source for the Jar is either a File (database from a file system)
+ * or an InputStream (database is in a jar file itself).
+ */
+abstract class JarFile {
 	final String[] name;
 	protected ZipFile zip;
 	boolean isStream;
 
-	JarFile() {
-		name = null;
-	}
-
 	JarFile(String[] name) {
 		this.name = name;
 	}
 
-	JarFile newJarFile(String[] name) {
-		return new JarFile(name);
-	}
-
 	final String getJarName() {
 		return IdUtil.mkQualifiedName(name);
 	}
@@ -112,7 +111,5 @@
 		return data;
 	}
 
-	Object[] getSigners(String className, ZipEntry ze) throws IOException {
-		return null;
-	}
+	abstract Object[] getSigners(String className, ZipEntry ze) throws IOException;
 }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/services/reflect/JarFileJava2.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/services/reflect/JarFileJava2.java?view=diff&rev=482812&r1=482811&r2=482812
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/services/reflect/JarFileJava2.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/services/reflect/JarFileJava2.java
Tue Dec  5 14:39:35 2006
@@ -45,18 +45,10 @@
 
 final class JarFileJava2 extends JarFile {
 
-	JarFileJava2() {
-		super();
-	}
-
 	JarFileJava2(String[] name) {
 		super(name);
 	}
-
-	JarFile newJarFile(String[] name) {
-		return new JarFileJava2(name);
-	}
-
+    
 	void initialize(File jarFile) throws IOException {
 
 		java.util.jar.JarFile jf = new java.util.jar.JarFile(jarFile);

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/services/reflect/JarLoader.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/services/reflect/JarLoader.java?view=diff&rev=482812&r1=482811&r2=482812
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/services/reflect/JarLoader.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/services/reflect/JarLoader.java
Tue Dec  5 14:39:35 2006
@@ -42,14 +42,6 @@
 
 class JarLoader extends ClassLoader {
 
-	private static final JarFile jarFileFactory;
-
-	static {
-
-		// 
-		jarFileFactory = new JarFileJava2();
-	}
-
 	private UpdateLoader updateLoader;
 	private JarFile jf;
 	private HeaderPrintWriter vs;
@@ -57,7 +49,7 @@
 	JarLoader(UpdateLoader updateLoader, String[] name, HeaderPrintWriter vs) {
 
 		this.updateLoader = updateLoader;
-		this.jf = jarFileFactory.newJarFile(name);
+		this.jf = new JarFileJava2(name);
 		this.vs = vs;
 	}
 
@@ -273,7 +265,7 @@
 
 		jf.setInvalid();
 		updateLoader = null;
-		return newJarFile ? jarFileFactory.newJarFile(jf.name) : null;
+		return newJarFile ? new JarFileJava2(jf.name) : null;
 	}
 
 	/*



Mime
View raw message