[jboss-cvs] JBossAS SVN: r61376 - in branches/Branch_4_2: testsuite/src/main/org/jboss/test/jmx/test and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Mar 16 12:49:18 EDT 2007


Author: anil.saldhana at jboss.com
Date: 2007-03-16 12:49:18 -0400 (Fri, 16 Mar 2007)
New Revision: 61376

Modified:
   branches/Branch_4_2/server/src/main/org/jboss/jmx/connector/invoker/AuthorizationInterceptor.java
   branches/Branch_4_2/testsuite/src/main/org/jboss/test/jmx/test/RMIAdaptorAuthorizationUnitTestCase.java
Log:
JBAS-4101:accomodate setAttribute calls

Modified: branches/Branch_4_2/server/src/main/org/jboss/jmx/connector/invoker/AuthorizationInterceptor.java
===================================================================
--- branches/Branch_4_2/server/src/main/org/jboss/jmx/connector/invoker/AuthorizationInterceptor.java	2007-03-16 16:46:18 UTC (rev 61375)
+++ branches/Branch_4_2/server/src/main/org/jboss/jmx/connector/invoker/AuthorizationInterceptor.java	2007-03-16 16:49:18 UTC (rev 61376)
@@ -25,6 +25,8 @@
 import java.lang.reflect.Method;
 import java.lang.reflect.UndeclaredThrowableException;
 import java.security.Principal;
+
+import javax.management.Attribute;
 import javax.management.ObjectName;
 import javax.security.auth.Subject;
  
@@ -50,9 +52,11 @@
  */
 public class AuthorizationInterceptor extends AbstractInterceptor
 {   
-   private Object authenticator = null;
-   private Method authorize;
+   protected Object authenticator = null;
+   protected Method authorize;
 
+   public final static String ATTRIBUTE_SET = "SetAttribute";
+   
    public AuthorizationInterceptor()
    {
       super();
@@ -106,8 +110,15 @@
             //Ignore calls like MBeanCount or getMBeanInfo
             if(obj != null && obj.length > 1)
             {
-               ObjectName objname = (ObjectName) obj[0];
-               String opname = (String) obj[1];
+               ObjectName objname = (ObjectName) obj[0]; 
+               String opname = null;
+               Object ob = obj[1];
+               
+               if(ob instanceof String)
+                  opname = (String)ob;
+               else if(ob instanceof Attribute)
+                  opname = ATTRIBUTE_SET;
+               else throw new IllegalArgumentException("Opname type not recognized"); 
 
                try
                {

Modified: branches/Branch_4_2/testsuite/src/main/org/jboss/test/jmx/test/RMIAdaptorAuthorizationUnitTestCase.java
===================================================================
--- branches/Branch_4_2/testsuite/src/main/org/jboss/test/jmx/test/RMIAdaptorAuthorizationUnitTestCase.java	2007-03-16 16:46:18 UTC (rev 61375)
+++ branches/Branch_4_2/testsuite/src/main/org/jboss/test/jmx/test/RMIAdaptorAuthorizationUnitTestCase.java	2007-03-16 16:49:18 UTC (rev 61376)
@@ -21,6 +21,7 @@
  */
 package org.jboss.test.jmx.test;
 
+import javax.management.Attribute;
 import javax.management.MBeanInfo;
 import javax.management.MBeanServerConnection;
 import javax.management.ObjectName;
@@ -68,6 +69,10 @@
       assertNotNull("MBeanInfo != null", info);
       Integer mbeanCount = conn.getMBeanCount();
       assertNotNull("mbeanCount != null", mbeanCount);
+      
+      //JBAS-4101: Accomodate setAttribute calls
+      ObjectName jaasService = new ObjectName("jboss.security:service=JaasSecurityManager");
+      conn.setAttribute(jaasService, new Attribute("DefaultCacheTimeout", Integer.valueOf(1000))); 
       lc.logout();
    }
    




More information about the jboss-cvs-commits mailing list