geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: incubator-geronimo/modules/core/src/java/org/apache/geronimo/jmx RelationshipMBeanProxyFactory.java
Date Wed, 20 Aug 2003 22:43:53 GMT
dain        2003/08/20 15:43:53

  Modified:    modules/core/src/java/org/apache/geronimo/jmx
                        RelationshipMBeanProxyFactory.java
  Log:
  Changed exception handling in getProxy to set the root cause of the exception in to the
  exception that is actually thrown.
  
  Revision  Changes    Path
  1.2       +12 -6     incubator-geronimo/modules/core/src/java/org/apache/geronimo/jmx/RelationshipMBeanProxyFactory.java
  
  Index: RelationshipMBeanProxyFactory.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/jmx/RelationshipMBeanProxyFactory.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RelationshipMBeanProxyFactory.java	13 Aug 2003 21:21:02 -0000	1.1
  +++ RelationshipMBeanProxyFactory.java	20 Aug 2003 22:43:53 -0000	1.2
  @@ -108,15 +108,21 @@
                           " targetRoleClass=" + iface.getName());
               }
           } catch (RelationNotFoundException e) {
  -            throw new IllegalStateException("MBean relationshipID is not registered: relationshipID="
+ relationshipID);
  +            IllegalStateException illegalStateException = new IllegalStateException("MBean
relationshipID is not registered: relationshipID=" + relationshipID);
  +            illegalStateException.initCause(e);
  +            throw illegalStateException;
           } catch (RelationTypeNotFoundException e) {
               // this is highly unlikely because we got the relation type from the MBeanServer,
but the type could
               // be unregistered between getting it and accessing the role
  -            throw new IllegalStateException("MBean relationshipID type is not registered:
relationshipID=" + relationshipID);
  +            IllegalStateException illegalStateException = new IllegalStateException("MBean
relationshipID type is not registered: relationshipID=" + relationshipID);
  +            illegalStateException.initCause(e);
  +            throw illegalStateException;
           } catch (RoleInfoNotFoundException e) {
  -            throw new IllegalStateException("MBean relationshipID does not have target
role:" +
  -                    " relationshipID=" + relationshipID +
  -                    " target=" + targetRole);
  +            IllegalStateException illegalStateException = new IllegalStateException("MBean
relationshipID does not have target role:" +
  +                                " relationshipID=" + relationshipID +
  +                                " target=" + targetRole);
  +            illegalStateException.initCause(e);
  +            throw illegalStateException;
           } catch (ClassNotFoundException e) {
               throw new IllegalArgumentException("Could not load Target Role class:" +
                       " relationshipID=" + relationshipID +
  
  
  

Mime
View raw message