FileDocCategorySizeDatePackage
SecurityActions.javaAPI DocJBoss 4.2.17305Fri Jul 13 20:53:52 BST 2007org.jboss.ejb3.security

SecurityActions

public class SecurityActions extends Object
A collection of privileged actions for this package

Copy paste from package org.jboss.ejb.plugins and org.jboss.ejb. Did not want to rely on this from org.jboss.ejb.plugins package since this is packaged in jboss.jar which will not be part of the embedded distribution.

author
Scott.Stark@jboss.org
author
Alexey Loubyansky
author
Kabir Khan
author
Anil.Saldhana@jboss.org
version
$Revison: 1.1$

Fields Summary
Constructors Summary
Methods Summary
static java.security.PrincipalgetCallerPrincipal()

      return (Principal)AccessController.doPrivileged(new PrivilegedAction(){

         public Object run()
         { 
            return SecurityAssociation.getCallerPrincipal();
         }});
   
static javax.security.auth.SubjectgetContextSubject()


       

        

       
    

     
            
   
      if (System.getSecurityManager() == null)
      {
         return PolicyContextActions.NON_PRIVILEGED.getContextSubject();
      }
      else
      {
         return PolicyContextActions.PRIVILEGED.getContextSubject();
      }
   
static org.jboss.security.RunAsIdentitypeekRunAsIdentity()

      if(System.getSecurityManager() == null)
      {
         return RunAsIdentityActions.NON_PRIVILEGED.peek();
      }
      else
      {
         return RunAsIdentityActions.PRIVILEGED.peek();
      }
   
static org.jboss.security.RunAsIdentitypopRunAsIdentity()

      if(System.getSecurityManager() == null)
      {
         return RunAsIdentityActions.NON_PRIVILEGED.pop();
      }
      else
      {
         return RunAsIdentityActions.PRIVILEGED.pop();
      }
   
static voidpushRunAsIdentity(org.jboss.security.RunAsIdentity principal)

      if(System.getSecurityManager() == null)
      {
         RunAsIdentityActions.NON_PRIVILEGED.push(principal);
      }
      else
      {
         RunAsIdentityActions.PRIVILEGED.push(principal);
      }
   
static java.lang.StringsetContextID(java.lang.String contextID)

      PrivilegedAction action = new SetContextID(contextID);
      String previousID = (String) AccessController.doPrivileged(action);
      return previousID;