Coverage Report - org.mule.module.spring.security.SpringSecurityContext
 
Classes in this File Line Coverage Branch Coverage Complexity
SpringSecurityContext
0%
0/9
N/A
1
 
 1  
 /*
 2  
  * $Id: AcegiSecurityContext.java 10662 2008-02-01 13:10:14Z romikk $
 3  
  * --------------------------------------------------------------------------------------
 4  
  * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.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.module.spring.security;
 12  
 
 13  
 import org.mule.api.security.Authentication;
 14  
 import org.mule.api.security.SecurityContext;
 15  
 
 16  
 import org.springframework.security.context.SecurityContextHolder;
 17  
 
 18  
 /**
 19  
  * <code>AcegiSecurityContext</code> is a SecurityContext wrapper used to
 20  
  * interface with an Acegi SecurityContext
 21  
  */
 22  
 
 23  
 public class SpringSecurityContext implements SecurityContext
 24  
 {
 25  
     private org.springframework.security.context.SecurityContext delegate;
 26  
     private SpringAuthenticationAdapter authentication;
 27  
 
 28  
     public SpringSecurityContext(org.springframework.security.context.SecurityContext delegate)
 29  0
     {
 30  0
         this.delegate = delegate;
 31  0
         SecurityContextHolder.setContext(this.delegate);
 32  0
     }
 33  
 
 34  
     public void setAuthentication(Authentication authentication)
 35  
     {
 36  0
         this.authentication = ((SpringAuthenticationAdapter)authentication);
 37  0
         delegate.setAuthentication(this.authentication.getDelegate());
 38  0
         SecurityContextHolder.setContext(delegate);
 39  0
     }
 40  
 
 41  
     public Authentication getAuthentication()
 42  
     {
 43  0
         return this.authentication;
 44  
     }
 45  
 }