Interface SecurityContextHolderStrategy
-
- All Known Implementing Classes:
ListeningSecurityContextHolderStrategy
public interface SecurityContextHolderStrategyA strategy for storing security context information against a thread.The preferred strategy is loaded by
SecurityContextHolder.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclearContext()Clears the current context.SecurityContextcreateEmptyContext()Creates a new, empty context implementation, for use by SecurityContextRepository implementations, when creating a new context for the first time.SecurityContextgetContext()Obtains the current context.voidsetContext(SecurityContext context)Sets the current context.
-
-
-
Method Detail
-
clearContext
void clearContext()
Clears the current context.
-
getContext
SecurityContext getContext()
Obtains the current context.- Returns:
- a context (never
null- create a default implementation if necessary)
-
setContext
void setContext(SecurityContext context)
Sets the current context.- Parameters:
context- to the new argument (should never benull, although implementations must check ifnullhas been passed and throw anIllegalArgumentExceptionin such cases)
-
createEmptyContext
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.
-
-