markt 2005/03/10 15:50:36
Modified: catalina/src/share/org/apache/catalina/util
CustomObjectInputStream.java
Log:
Fix bug 22041. Dynamic proxies are now supported as sesison objects.
- Implemented using the code from
org.apache.geronimo.network.ResolvingObjectInputStream
Revision Changes Path
1.5 +21 -1
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/CustomObjectInputStream.java
Index: CustomObjectInputStream.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/CustomObjectInputStream.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- CustomObjectInputStream.java 2 Sep 2004 18:45:17 -0000 1.4
+++ CustomObjectInputStream.java 10 Mar 2005 23:50:36 -0000 1.5
@@ -20,6 +20,7 @@
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectStreamClass;
+import java.lang.reflect.Proxy;
/**
* Custom subclass of <code>ObjectInputStream</code> that loads from the
@@ -70,4 +71,23 @@
return Class.forName(classDesc.getName(), false, classLoader);
}
+
+ /**
+ * Return a proxy class that implements the interfaces named in a proxy
+ * class descriptor. Do this using the class loader assigned to this
+ * Context.
+ */
+ protected Class resolveProxyClass(String[] interfaces)
+ throws IOException, ClassNotFoundException {
+
+ Class[] cinterfaces = new Class[interfaces.length];
+ for (int i = 0; i < interfaces.length; i++)
+ cinterfaces[i] = classLoader.loadClass(interfaces[i]);
+
+ try {
+ return Proxy.getProxyClass(classLoader, cinterfaces);
+ } catch (IllegalArgumentException e) {
+ throw new ClassNotFoundException(null, e);
+ }
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]