geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ke...@apache.org
Subject svn commit: r527300 - /geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/connectiontracking/ConnectionTrackingCoordinator.java
Date Tue, 10 Apr 2007 21:11:16 GMT
Author: kevan
Date: Tue Apr 10 14:11:15 2007
New Revision: 527300

URL: http://svn.apache.org/viewvc?view=rev&rev=527300
Log:
GERONIMO-3087 Fix exceptions that can be thrown by ConnectionTrackingCoordinator.invoke().
Otherwise, UndeclaredThrowableExceptions will be thrown to client code

Modified:
    geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/connectiontracking/ConnectionTrackingCoordinator.java

Modified: geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/connectiontracking/ConnectionTrackingCoordinator.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/connectiontracking/ConnectionTrackingCoordinator.java?view=diff&rev=527300&r1=527299&r2=527300
==============================================================================
--- geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/connectiontracking/ConnectionTrackingCoordinator.java
(original)
+++ geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/outbound/connectiontracking/ConnectionTrackingCoordinator.java
Tue Apr 10 14:11:15 2007
@@ -24,6 +24,7 @@
 import java.util.Set;
 import java.lang.reflect.Proxy;
 import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import javax.resource.ResourceException;
 import javax.resource.spi.DissociatableManagedConnection;
@@ -326,8 +327,19 @@
             } else {
                 handle = getHandle();
             }
-            Object value = method.invoke(handle, args);
-            return value;
+            
+            try {
+                Object value = method.invoke(handle, args);
+                return value;
+            } catch (InvocationTargetException ite) {
+                // catch InvocationTargetExceptions and turn them into the target exception
(if there is one)
+                Throwable t = ite.getTargetException();
+                if (t != null) {
+                    throw t;
+                }
+                throw ite;
+            }
+
         }
 
         public synchronized boolean isReleased() {



Mime
View raw message