[jboss-cvs] JBossAS SVN: r97516 - trunk/server/src/main/java/org/jboss/jmx/connector/invoker.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Dec 7 12:23:57 EST 2009


Author: sguilhen at redhat.com
Date: 2009-12-07 12:23:56 -0500 (Mon, 07 Dec 2009)
New Revision: 97516

Modified:
   trunk/server/src/main/java/org/jboss/jmx/connector/invoker/InvokerAdaptorService.java
Log:
JBAS-7517: porting changes made to InvokerAdaptorService to trunk

Modified: trunk/server/src/main/java/org/jboss/jmx/connector/invoker/InvokerAdaptorService.java
===================================================================
--- trunk/server/src/main/java/org/jboss/jmx/connector/invoker/InvokerAdaptorService.java	2009-12-07 17:08:23 UTC (rev 97515)
+++ trunk/server/src/main/java/org/jboss/jmx/connector/invoker/InvokerAdaptorService.java	2009-12-07 17:23:56 UTC (rev 97516)
@@ -215,6 +215,9 @@
          if (newCL != null && newCL != oldCL)
             SecurityActions.setContextClassLoader(newCL);
 
+         //JBAS-6449: Cache the incoming security context to be retained on exit
+         SecurityContext previousSecurityContext = SecurityActions.getSecurityContext();
+
          try
          {
             // Set the method hash to Method mapping
@@ -275,8 +278,11 @@
          finally
          {
             // Restore the input security context
-            SecurityActions.popSubjectContext();  
-            SecurityActions.clearSecurityContext();
+            SecurityActions.popSubjectContext();
+            if(previousSecurityContext != null)
+               SecurityActions.setSecurityContext(previousSecurityContext);
+            else
+               SecurityActions.clearSecurityContext();
             // Restore the input class loader
             if (newCL != null && newCL != oldCL)
                SecurityActions.setContextClassLoader(oldCL);




More information about the jboss-cvs-commits mailing list