[jboss-cvs] JBossAS SVN: r111178 - in projects/ejb3/branches/jboss-ejb3-core-1.1.22_JBPAPP-6230: src/main/java/org/jboss/ejb3/mdb/inflow and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Apr 13 08:58:06 EDT 2011


Author: raggz
Date: 2011-04-13 08:58:06 -0400 (Wed, 13 Apr 2011)
New Revision: 111178

Modified:
   projects/ejb3/branches/jboss-ejb3-core-1.1.22_JBPAPP-6230/
   projects/ejb3/branches/jboss-ejb3-core-1.1.22_JBPAPP-6230/src/main/java/org/jboss/ejb3/mdb/inflow/MessageInflowLocalProxy.java
Log:
JIRA JBPAPP-6230 - back port of JBPAPP-5516.



Property changes on: projects/ejb3/branches/jboss-ejb3-core-1.1.22_JBPAPP-6230
___________________________________________________________________
Added: svn:mergeinfo
   + /projects/ejb3/branches/jboss-ejb3-core-1.3:111086

Modified: projects/ejb3/branches/jboss-ejb3-core-1.1.22_JBPAPP-6230/src/main/java/org/jboss/ejb3/mdb/inflow/MessageInflowLocalProxy.java
===================================================================
--- projects/ejb3/branches/jboss-ejb3-core-1.1.22_JBPAPP-6230/src/main/java/org/jboss/ejb3/mdb/inflow/MessageInflowLocalProxy.java	2011-04-13 12:39:37 UTC (rev 111177)
+++ projects/ejb3/branches/jboss-ejb3-core-1.1.22_JBPAPP-6230/src/main/java/org/jboss/ejb3/mdb/inflow/MessageInflowLocalProxy.java	2011-04-13 12:58:06 UTC (rev 111178)
@@ -23,6 +23,7 @@
 
 import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.Method;
+import java.lang.reflect.UndeclaredThrowableException;
 import java.util.concurrent.atomic.AtomicBoolean;
 
 import javax.resource.ResourceException;
@@ -263,7 +264,18 @@
          throw new ResourceException(t);
       }
    }
-   
+
+   private static boolean checked(Method method, Class<?> exceptionType)
+   {
+      final Class<?>[] allowedExceptionTypes = method.getExceptionTypes();
+      for (Class<?> allowedExceptionType : allowedExceptionTypes)
+      {
+         if (allowedExceptionType.isAssignableFrom(exceptionType))
+            return true;
+      }
+      return false;
+   }
+
    /**
     * Delivery.
     * 
@@ -302,6 +314,11 @@
       {
          if (trace)
             log.trace("MessageEndpoint " + getProxyString(proxy) + " delivery error", t);
+         if (t instanceof Exception)
+         {
+            if (!(t instanceof RuntimeException) && !checked(method, t.getClass()))
+               t = new UndeclaredThrowableException(t);
+         }
          if (t instanceof Error || t instanceof RuntimeException)
          {
             if (transaction != null)



More information about the jboss-cvs-commits mailing list