openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1515809 - /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/OwbCustomObjectInputStream.java
Date Tue, 20 Aug 2013 12:59:49 GMT
Author: rmannibucau
Date: Tue Aug 20 12:59:49 2013
New Revision: 1515809

URL: http://svn.apache.org/r1515809
Log:
fixing our OwbCustomObjectInputStream implementation to handle resolveProxyClass

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/OwbCustomObjectInputStream.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/OwbCustomObjectInputStream.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/OwbCustomObjectInputStream.java?rev=1515809&r1=1515808&r2=1515809&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/OwbCustomObjectInputStream.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/OwbCustomObjectInputStream.java
Tue Aug 20 12:59:49 2013
@@ -22,6 +22,7 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.ObjectInputStream;
 import java.io.ObjectStreamClass;
+import java.lang.reflect.Proxy;
 
 public class OwbCustomObjectInputStream extends ObjectInputStream
 {
@@ -39,4 +40,22 @@ public class OwbCustomObjectInputStream 
         return Class.forName(desc.getName(), false, classLoader);
     }
 
+    @Override
+    protected Class resolveProxyClass(String[] interfaces) throws IOException, ClassNotFoundException
+    {
+        final Class[] cinterfaces = new Class[interfaces.length];
+        for (int i = 0; i < interfaces.length; i++)
+        {
+            cinterfaces[i] = Class.forName(interfaces[i], false, classLoader);
+        }
+
+        try
+        {
+            return Proxy.getProxyClass(classLoader, cinterfaces);
+        }
+        catch (IllegalArgumentException e)
+        {
+            throw new ClassNotFoundException(null, e);
+        }
+    }
 }



Mime
View raw message