[jboss-cvs] JBossAS SVN: r59535 - branches/Branch_4_0/testsuite/src/main/org/jboss/test/jbossmx/compliance/modelmbean.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Jan 11 12:22:19 EST 2007


Author: dimitris at jboss.org
Date: 2007-01-11 12:22:17 -0500 (Thu, 11 Jan 2007)
New Revision: 59535

Modified:
   branches/Branch_4_0/testsuite/src/main/org/jboss/test/jbossmx/compliance/modelmbean/ModelMBeanTestCase.java
Log:
JBAS-3614, the jdk implementation of RequiredModelMBean requires the attribute to be declared as operation(s), too. This is not a requirement of the JMX 1.2 spec, though.

Modified: branches/Branch_4_0/testsuite/src/main/org/jboss/test/jbossmx/compliance/modelmbean/ModelMBeanTestCase.java
===================================================================
--- branches/Branch_4_0/testsuite/src/main/org/jboss/test/jbossmx/compliance/modelmbean/ModelMBeanTestCase.java	2007-01-11 17:21:35 UTC (rev 59534)
+++ branches/Branch_4_0/testsuite/src/main/org/jboss/test/jbossmx/compliance/modelmbean/ModelMBeanTestCase.java	2007-01-11 17:22:17 UTC (rev 59535)
@@ -24,6 +24,7 @@
 import javax.management.Attribute;
 import javax.management.Descriptor;
 import javax.management.MBeanOperationInfo;
+import javax.management.MBeanParameterInfo;
 import javax.management.MBeanServer;
 import javax.management.MBeanServerFactory;
 import javax.management.ObjectName;
@@ -252,6 +253,41 @@
             descr2
          );
 
+      // JBAS-3614 - the jdk implementation of RequiredModelMBean
+      // requires the attribute to be declared as operation(s), too.
+      // This is not a requirement of the JMX 1.2 spec, though.
+      
+      // build 'getpojoAttribute' operation
+      Descriptor descr21 = new DescriptorSupport();
+      descr21.setField("name", "getpojoAttribute");
+      descr21.setField("descriptorType", "operation");
+      
+      ModelMBeanOperationInfo getpojoAttributeOperation =
+         new ModelMBeanOperationInfo(
+            "getpojoAttribute",           // name
+            "A simple operation.",        // description
+            null,                         // signature
+            int.class.getName(),          // return type
+            MBeanOperationInfo.INFO,      // impact
+            descr21                       // descriptor
+         );
+      
+      // build 'setpojoAttribute' operation
+      Descriptor descr22 = new DescriptorSupport();
+      descr22.setField("name", "setpojoAttribute");
+      descr22.setField("descriptorType", "operation");
+      
+      ModelMBeanOperationInfo setpojoAttributeOperation =
+         new ModelMBeanOperationInfo(
+            "setpojoAttribute",           // name
+            "A simple operation.",        // description
+            new MBeanParameterInfo[]      // signature
+                  { new MBeanParameterInfo("int", int.class.getName(), "int setter") },
+            void.class.getName(),         // return type
+            MBeanOperationInfo.ACTION,    // impact
+            descr22                       // descriptor
+         );
+      
       // build 'pojoOperation' operation
       Descriptor descr3 = new DescriptorSupport();
       descr3.setField("name", "pojoOperation");
@@ -281,6 +317,8 @@
                                },
                                null,                                // constructors
                                new ModelMBeanOperationInfo[] {      // operations
+                                     getpojoAttributeOperation,
+                                     setpojoAttributeOperation,
                                      pojoOperationInfo
                                },
                                null,                                // notifications




More information about the jboss-cvs-commits mailing list