1 10 11 package org.mule.extras.acegi; 12 13 import org.acegisecurity.context.SecurityContext; 14 import org.acegisecurity.context.SecurityContextHolder; 15 import org.mule.umo.security.UMOAuthentication; 16 import org.mule.umo.security.UMOSecurityContext; 17 18 22 23 public class AcegiSecurityContext implements UMOSecurityContext 24 { 25 private SecurityContext delegate; 26 private AcegiAuthenticationAdapter authentication; 27 28 public AcegiSecurityContext(SecurityContext delegate) 29 { 30 this.delegate = delegate; 31 SecurityContextHolder.setContext(this.delegate); 32 } 33 34 public void setAuthentication(UMOAuthentication authentication) 35 { 36 this.authentication = ((AcegiAuthenticationAdapter)authentication); 37 delegate.setAuthentication(this.authentication.getDelegate()); 38 SecurityContextHolder.setContext(delegate); 39 } 40 41 public UMOAuthentication getAuthentication() 42 { 43 return this.authentication; 44 } 45 } 46 | Popular Tags |