Spring Security Framework

org.springframework.security.context
Class GlobalSecurityContextHolderStrategy

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

public class GlobalSecurityContextHolderStrategy
extends Object
implements SecurityContextHolderStrategy

A static field-based implementation of SecurityContextHolderStrategy.

This means that all instances in the JVM share the same SecurityContext. This is generally useful with rich clients, such as Swing.

Version:
$Id$
Author:
Ben Alex

Constructor Summary
GlobalSecurityContextHolderStrategy()
           
 
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

GlobalSecurityContextHolderStrategy

public GlobalSecurityContextHolderStrategy()
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.