[jboss-cvs] JBossAS SVN: r94781 - projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/impl.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Oct 13 13:57:08 EDT 2009


Author: jesper.pedersen
Date: 2009-10-13 13:57:08 -0400 (Tue, 13 Oct 2009)
New Revision: 94781

Modified:
   projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/impl/DeploymentDeployer.java
Log:
Propagate exceptions from create() and start()

Modified: projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/impl/DeploymentDeployer.java
===================================================================
--- projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/impl/DeploymentDeployer.java	2009-10-13 16:40:22 UTC (rev 94780)
+++ projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/impl/DeploymentDeployer.java	2009-10-13 17:57:08 UTC (rev 94781)
@@ -32,6 +32,7 @@
 import org.jboss.jca.fungal.deployment.PropertyType;
 import org.jboss.jca.fungal.deployment.Unmarshaller;
 
+import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.net.InetAddress;
 import java.net.URL;
@@ -281,10 +282,10 @@
        * @param bt The bean type definition
        * @param cl The classloader
        * @return The new bean
-       * @exception Exception Thrown if an error occurs
+       * @exception Throwable Thrown if an error occurs
        */
       @SuppressWarnings("unchecked") 
-      private Object createBean(BeanType bt, ClassLoader cl) throws Exception
+      private Object createBean(BeanType bt, ClassLoader cl) throws Throwable
       {
          Class<?> clz = null;
          Object instance = null;
@@ -397,20 +398,28 @@
             Method createMethod = clz.getMethod("create", (Class[])null);
             createMethod.invoke(instance, (Object[])null);
          }
-         catch (Exception e)
+         catch (NoSuchMethodException nsme)
          {
             // No create method
          }
+         catch (InvocationTargetException ite)
+         {
+            throw ite.getTargetException();
+         }
 
          try
          {
             Method startMethod = clz.getMethod("start", (Class[])null);
             startMethod.invoke(instance, (Object[])null);
          }
-         catch (Exception e)
+         catch (NoSuchMethodException nsme)
          {
             // No start method
          }
+         catch (InvocationTargetException ite)
+         {
+            throw ite.getTargetException();
+         }
 
          // Register deployer
          if (instance instanceof Deployer)




More information about the jboss-cvs-commits mailing list