mx4j/src/core/javax/management/modelmbean ModelMBeanInfoSupport.java, 1.18, 1.19

Simone Bordet <[email protected]> Wed, 13 Sep 2006 21:48:33 +0000
Newsgroups gmane.comp.java.mx4j.cvs
Message-ID <[email protected]>
Update of /cvsroot/mx4j/mx4j/src/core/javax/management/modelmbean
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv5636

Modified Files:
	ModelMBeanInfoSupport.java 
Log Message:
Fix for bug #1540419: "ModelMBeanInfoSupport.getDescriptor(name, "mbean") returns null.
Fixed both getDescriptor(String, String) and setDescriptor(Descriptor, String).

Index: ModelMBeanInfoSupport.java
===================================================================
RCS file: /cvsroot/mx4j/mx4j/src/core/javax/management/modelmbean/ModelMBeanInfoSupport.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** ModelMBeanInfoSupport.java	9 Feb 2005 07:07:56 -0000	1.18
--- ModelMBeanInfoSupport.java	13 Sep 2006 21:48:30 -0000	1.19
***************
*** 12,15 ****
--- 12,16 ----
  import java.util.Arrays;
  import java.util.List;
+ 
  import javax.management.Descriptor;
  import javax.management.DescriptorAccess;
***************
*** 276,280 ****
        //if (type == null) {throw new RuntimeOperationsException(new IllegalArgumentException("Descriptor type cannot be null"));}
  
!       if ("MBean".equals(type))
        {
           return getMBeanDescriptor();
--- 277,281 ----
        //if (type == null) {throw new RuntimeOperationsException(new IllegalArgumentException("Descriptor type cannot be null"));}
  
!       if ("mbean".equals(type))
        {
           return getMBeanDescriptor();
***************
*** 356,364 ****
  
        // Now decide from the descriptor type where to find the right descriptor
!       if (descriptorType.equals("MBean"))
        {
           setMBeanDescriptor(descriptor);
        }
!       else if (descriptorType.equals("attribute"))
        {
           MBeanAttributeInfo[] attrs = modelMBeanAttributes;
--- 357,365 ----
  
        // Now decide from the descriptor type where to find the right descriptor
!       if ("mbean".equals(descriptorType))
        {
           setMBeanDescriptor(descriptor);
        }
!       else if ("attribute".equals(descriptorType))
        {
           MBeanAttributeInfo[] attrs = modelMBeanAttributes;
***************
*** 377,381 ****
           }
        }
!       else if (descriptorType.equals("notification"))
        {
           MBeanNotificationInfo[] notifs = modelMBeanNotifications;
--- 378,382 ----
           }
        }
!       else if ("notification".equals(descriptorType))
        {
           MBeanNotificationInfo[] notifs = modelMBeanNotifications;
***************
*** 394,398 ****
           }
        }
!       else if (descriptorType.equals("constructor"))
        {
           MBeanConstructorInfo[] ctors = modelMBeanConstructors;
--- 395,399 ----
           }
        }
!       else if ("constructor".equals(descriptorType))
        {
           MBeanConstructorInfo[] ctors = modelMBeanConstructors;
***************
*** 411,415 ****
           }
        }
!       else if (descriptorType.equals("operation")/* || descriptorType.equals("getter") || descriptorType.equals("setter")*/)
        {
           MBeanOperationInfo[] opers = modelMBeanOperations;
--- 412,416 ----
           }
        }
!       else if ("operation".equals(descriptorType)/* || descriptorType.equals("getter") || descriptorType.equals("setter")*/)
        {
           MBeanOperationInfo[] opers = modelMBeanOperations;
***************
*** 676,680 ****
        String[] names = new String[]{"name", "descriptorType", "displayName", "persistPolicy", "log", "export", "visibility"};
        int index = getClassName().lastIndexOf('.') + 1;
!       Object[] values = new Object[]{getClassName().substring(index), "MBean", getClassName(), "Never", "F", "F", "1"};
        return new DescriptorSupport(names, values);
     }
--- 677,681 ----
        String[] names = new String[]{"name", "descriptorType", "displayName", "persistPolicy", "log", "export", "visibility"};
        int index = getClassName().lastIndexOf('.') + 1;
!       Object[] values = new Object[]{getClassName().substring(index), "mbean", getClassName(), "Never", "F", "F", "1"};
        return new DescriptorSupport(names, values);
     }


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642