Spring Security Framework

org.springframework.security.context
Class ThreadLocalSecurityContextHolderStrategy

java.lang.Object
  extended by org.springframework.security.context.ThreadLocalSecurityContextHolderStrategy
All Implemented Interfaces:
SecurityContextHolderStrategy

public class ThreadLocalSecurityContextHolderStrategy
extends Object
implements SecurityContextHolderStrategy

A ThreadLocal-based implementation of SecurityContextHolderStrategy.

Version:
$Id$
Author:
Ben Alex
See Also:
ThreadLocal, HttpSessionContextIntegrationFilter

Constructor Summary
ThreadLocalSecurityContextHolderStrategy()
           
 
Method Summary
 void clearContext()
          Clears the current context.
 SecurityContext getContext()
          Obtains the current context.
 void setContext(SecurityContext context)
          Sets the current context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThreadLocalSecurityContextHolderStrategy

public ThreadLocalSecurityContextHolderStrategy()
Method Detail

clearContext

public void clearContext()
Description copied from interface: SecurityContextHolderStrategy
Clears the current context.

Specified by:
clearContext in interface SecurityContextHolderStrategy

getContext

public SecurityContext getContext()
Description copied from interface: SecurityContextHolderStrategy
Obtains the current context.

Specified by:
getContext in interface SecurityContextHolderStrategy
Returns:
a context (never null - create a default implementation if necessary)

setContext

public void setContext(SecurityContext context)
Description copied from interface: SecurityContextHolderStrategy
Sets the current context.

Specified by:
setContext in interface SecurityContextHolderStrategy
Parameters:
context - to the new argument (should never be null, although implementations must check if null has been passed and throw an IllegalArgumentException in such cases)

Spring Security Framework

Copyright © 2004-2010 SpringSource, Inc. All Rights Reserved.