camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1468007 - in /camel/branches/camel-2.10.x: ./ components/camel-sql/ components/camel-sql/src/main/java/org/apache/camel/processor/aggregate/jdbc/ClassLoadingAwareObjectInputStream.java
Date Mon, 15 Apr 2013 12:59:18 GMT
Author: davsclaus
Date: Mon Apr 15 12:59:18 2013
New Revision: 1468007

URL: http://svn.apache.org/r1468007
Log:
CAMEL-6283: Restarting routes using sql aggregation repository may lead to Class loading issues

Modified:
    camel/branches/camel-2.10.x/   (props changed)
    camel/branches/camel-2.10.x/components/camel-sql/   (props changed)
    camel/branches/camel-2.10.x/components/camel-sql/src/main/java/org/apache/camel/processor/aggregate/jdbc/ClassLoadingAwareObjectInputStream.java

Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
  Merged /camel/trunk:r1468004

Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Propchange: camel/branches/camel-2.10.x/components/camel-sql/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Mon Apr 15 12:59:18 2013
@@ -14,3 +14,5 @@ eclipse-classes
 *.ipr
 *.iml
 *.iws
+*.idea
+derby.log

Modified: camel/branches/camel-2.10.x/components/camel-sql/src/main/java/org/apache/camel/processor/aggregate/jdbc/ClassLoadingAwareObjectInputStream.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-sql/src/main/java/org/apache/camel/processor/aggregate/jdbc/ClassLoadingAwareObjectInputStream.java?rev=1468007&r1=1468006&r2=1468007&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/components/camel-sql/src/main/java/org/apache/camel/processor/aggregate/jdbc/ClassLoadingAwareObjectInputStream.java
(original)
+++ camel/branches/camel-2.10.x/components/camel-sql/src/main/java/org/apache/camel/processor/aggregate/jdbc/ClassLoadingAwareObjectInputStream.java
Mon Apr 15 12:59:18 2013
@@ -21,7 +21,6 @@ import java.io.InputStream;
 import java.io.ObjectInputStream;
 import java.io.ObjectStreamClass;
 import java.lang.reflect.Proxy;
-import java.util.HashMap;
 
 import org.apache.camel.CamelContext;
 
@@ -30,11 +29,6 @@ import org.apache.camel.CamelContext;
  */
 public class ClassLoadingAwareObjectInputStream extends ObjectInputStream {
 
-    /**
-     * <p>Maps primitive type names to corresponding class objects.</p>
-     */
-    private static final HashMap<String, Class<?>> PRIM_CLASSES = new HashMap<String,
Class<?>>(8, 1.0F);
-    
     private CamelContext camelContext;
 
     public ClassLoadingAwareObjectInputStream(CamelContext camelContext, InputStream in)
throws IOException {
@@ -44,16 +38,14 @@ public class ClassLoadingAwareObjectInpu
 
     @Override
     protected Class<?> resolveClass(ObjectStreamClass classDesc) throws IOException,
ClassNotFoundException {
-        ClassLoader cl = Thread.currentThread().getContextClassLoader();
-        return camelContext.getClassResolver().resolveClass(classDesc.getName(), cl);
+        return camelContext.getClassResolver().resolveClass(classDesc.getName());
     }
 
     @Override
     protected Class<?> resolveProxyClass(String[] interfaces) throws IOException, ClassNotFoundException
{
-        ClassLoader cl = Thread.currentThread().getContextClassLoader();
         Class<?>[] cinterfaces = new Class[interfaces.length];
         for (int i = 0; i < interfaces.length; i++) {
-            cinterfaces[i] = camelContext.getClassResolver().resolveClass(interfaces[i],
cl);
+            cinterfaces[i] = camelContext.getClassResolver().resolveClass(interfaces[i]);
         }
 
         try {
@@ -63,16 +55,4 @@ public class ClassLoadingAwareObjectInpu
         }
     }
 
-    static {
-        PRIM_CLASSES.put("boolean", boolean.class);
-        PRIM_CLASSES.put("byte", byte.class);
-        PRIM_CLASSES.put("char", char.class);
-        PRIM_CLASSES.put("short", short.class);
-        PRIM_CLASSES.put("int", int.class);
-        PRIM_CLASSES.put("long", long.class);
-        PRIM_CLASSES.put("float", float.class);
-        PRIM_CLASSES.put("double", double.class);
-        PRIM_CLASSES.put("void", void.class);
-    }
-
 }



Mime
View raw message