1 7 package org.jboss.security.jndi; 8 9 import java.security.PrivilegedAction ; 10 import java.security.Principal ; 11 import java.security.AccessController ; 12 13 import javax.security.auth.Subject ; 14 15 import org.jboss.security.SecurityAssociation; 16 17 23 class SecurityAssociationActions 24 { 25 private static class SetPrincipalInfoAction implements PrivilegedAction 26 { 27 Principal principal; 28 Object credential; 29 SetPrincipalInfoAction(Principal principal, Object credential) 30 { 31 this.principal = principal; 32 this.credential = credential; 33 } 34 public Object run() 35 { 36 SecurityAssociation.setCredential(credential); 37 credential = null; 38 SecurityAssociation.setPrincipal(principal); 39 principal = null; 40 return null; 41 } 42 } 43 44 static void setPrincipalInfo(Principal principal, Object credential) 45 { 46 SetPrincipalInfoAction action = new SetPrincipalInfoAction(principal, credential); 47 AccessController.doPrivileged(action); 48 } 49 50 } 51 | Popular Tags |