public interface

SecurityContextHolderStrategy

org.springframework.security.core.context.SecurityContextHolderStrategy

Class Overview

A strategy for storing security context information against a thread.

The preferred strategy is loaded by SecurityContextHolder.

Summary

Public Methods
abstract void clearContext()
Clears the current context.
abstract SecurityContext createEmptyContext()
Creates a new, empty context implementation, for use by SecurityContextRepository implementations, when creating a new context for the first time.
abstract SecurityContext getContext()
Obtains the current context.
abstract void setContext(SecurityContext context)
Sets the current context.

Public Methods

public abstract void clearContext ()

Clears the current context.

public abstract SecurityContext createEmptyContext ()

Creates a new, empty context implementation, for use by SecurityContextRepository implementations, when creating a new context for the first time.

Returns
  • the empty context.

public abstract SecurityContext getContext ()

Obtains the current context.

Returns
  • a context (never null - create a default implementation if necessary)

public abstract void setContext (SecurityContext context)

Sets the current context.

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)