You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by da...@apache.org on 2004/02/11 03:55:28 UTC

cvs commit: incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/gbean/jmx GBeanMBeanAttribute.java

dain        2004/02/10 18:55:28

  Modified:    modules/kernel/src/java/org/apache/geronimo/gbean/jmx
                        GBeanMBeanAttribute.java
  Log:
  A little better exception handling...
  
  Revision  Changes    Path
  1.6       +10 -4     incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/gbean/jmx/GBeanMBeanAttribute.java
  
  Index: GBeanMBeanAttribute.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/gbean/jmx/GBeanMBeanAttribute.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- GBeanMBeanAttribute.java	29 Jan 2004 06:03:35 -0000	1.5
  +++ GBeanMBeanAttribute.java	11 Feb 2004 02:55:28 -0000	1.6
  @@ -274,14 +274,20 @@
           return mbeanAttributeInfo;
       }
   
  -    public void online() throws ReflectionException {
  +    public void online() throws Exception {
           if (persistent && !isConstructorArg && setInvoker != null) {
               ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
               try {
                   Thread.currentThread().setContextClassLoader(gmbean.getClassLoader());
                   setInvoker.invoke(gmbean.getTarget(), new Object[]{persistentValue});
  -            } catch (Throwable throwable) {
  -                throw new ReflectionException(new InvocationTargetException(throwable));
  +            } catch (InvocationTargetException e) {
  +                Throwable targetException = e.getTargetException();
  +                if(targetException instanceof Exception) {
  +                    throw (Exception)targetException;
  +                } else if (targetException instanceof Error) {
  +                    throw (Error)targetException;
  +                }
  +                throw e;
               } finally {
                   Thread.currentThread().setContextClassLoader(oldClassLoader);
               }