servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r384777 - /incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/BaseStandardMBean.java
Date Fri, 10 Mar 2006 12:38:27 GMT
Author: gnodet
Date: Fri Mar 10 04:38:24 2006
New Revision: 384777

URL: http://svn.apache.org/viewcvs?rev=384777&view=rev
Log:
SM-345: Improve JMX Exception throwing in BaseStandardMBean
Patch submitted by Simone Bordet, thanks!

Modified:
    incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/BaseStandardMBean.java

Modified: incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/BaseStandardMBean.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/BaseStandardMBean.java?rev=384777&r1=384776&r2=384777&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/BaseStandardMBean.java
(original)
+++ incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/BaseStandardMBean.java
Fri Mar 10 04:38:24 2006
@@ -178,13 +178,17 @@
                 ca.updateAttribute(beanUtil, attr);
                 sendAttributeChangeNotification(old, attr);
             }
+            catch (NoSuchMethodException e) {
+                throw new ReflectionException(e);
+            }
             catch (IllegalAccessException e) {
-                throw new MBeanException(e);
+                throw new ReflectionException(e);
             }
             catch (InvocationTargetException e) {
-                throw new MBeanException(e);
-            }
-            catch (NoSuchMethodException e) {
+                Throwable t = e.getTargetException();
+                if (t instanceof Exception) {
+                    throw new MBeanException(e);
+                }
                 throw new MBeanException(e);
             }
         }
@@ -309,10 +313,11 @@
             throw new ReflectionException(e);
         }
         catch (InvocationTargetException e) {
-            if (e.getTargetException() instanceof Exception) {
-                throw new ReflectionException((Exception) e.getTargetException());
+            Throwable t = e.getTargetException();
+            if (t instanceof Exception) {
+                throw new MBeanException((Exception)t);
             } else {
-                throw new ReflectionException(e);
+                throw new MBeanException(e);
             }
         }
     }



Mime
View raw message