Coverage Report - org.mule.extras.acegi.AcegiSecurityContext
 
Classes in this File Line Coverage Branch Coverage Complexity
AcegiSecurityContext
0%
0/9
N/A
1
 
 1  
 /*
 2  
  * $Id: AcegiSecurityContext.java 7976 2007-08-21 14:26:13Z dirk.olmes $
 3  
  * --------------------------------------------------------------------------------------
 4  
  * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
 5  
  *
 6  
  * The software in this package is published under the terms of the CPAL v1.0
 7  
  * license, a copy of which has been included with this distribution in the
 8  
  * LICENSE.txt file.
 9  
  */
 10  
 
 11  
 package org.mule.extras.acegi;
 12  
 
 13  
 import org.mule.umo.security.UMOAuthentication;
 14  
 import org.mule.umo.security.UMOSecurityContext;
 15  
 
 16  
 import org.acegisecurity.context.SecurityContext;
 17  
 import org.acegisecurity.context.SecurityContextHolder;
 18  
 
 19  
 /**
 20  
  * <code>AcegiSecurityContext</code> is a UMOSecurityContext wrapper used to
 21  
  * interface with an Acegi SecurityContext
 22  
  */
 23  
 
 24  
 public class AcegiSecurityContext implements UMOSecurityContext
 25  
 {
 26  
     private SecurityContext delegate;
 27  
     private AcegiAuthenticationAdapter authentication;
 28  
 
 29  
     public AcegiSecurityContext(SecurityContext delegate)
 30  0
     {
 31  0
         this.delegate = delegate;
 32  0
         SecurityContextHolder.setContext(this.delegate);
 33  0
     }
 34  
 
 35  
     public void setAuthentication(UMOAuthentication authentication)
 36  
     {
 37  0
         this.authentication = ((AcegiAuthenticationAdapter)authentication);
 38  0
         delegate.setAuthentication(this.authentication.getDelegate());
 39  0
         SecurityContextHolder.setContext(delegate);
 40  0
     }
 41  
 
 42  
     public UMOAuthentication getAuthentication()
 43  
     {
 44  0
         return this.authentication;
 45  
     }
 46  
 }