Package cn.dev33.satoken.context
Class SaTokenContextForThreadLocal
java.lang.Object
cn.dev33.satoken.context.SaTokenContextForThreadLocal
- All Implemented Interfaces:
SaTokenContext
Sa-Token 上下文处理器 [ ThreadLocal 版本 ]
使用 [ ThreadLocal 版本 ] 上下文处理器需要在全局过滤器或者拦截器内率先调用 SaTokenContextForThreadLocalStaff.setBox(req, res, sto) 初始化上下文
一般情况下你不需要直接操作此类,因为框架的 starter 集成包里已经封装了完整的上下文操作
- Since:
- 1.16.0
- Author:
- click33
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid清除化上下文获取 Box 对象booleanisValid()判断当前上下文是否可用voidsetContext(SaRequest req, SaResponse res, SaStorage stg) 初始化上下文Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface cn.dev33.satoken.context.SaTokenContext
getRequest, getResponse, getStorage
-
Constructor Details
-
SaTokenContextForThreadLocal
public SaTokenContextForThreadLocal()
-
-
Method Details
-
setContext
Description copied from interface:SaTokenContext初始化上下文- Specified by:
setContextin interfaceSaTokenContext- Parameters:
req- /res- /stg- /
-
clearContext
public void clearContext()Description copied from interface:SaTokenContext清除化上下文- Specified by:
clearContextin interfaceSaTokenContext
-
isValid
public boolean isValid()Description copied from interface:SaTokenContext判断当前上下文是否可用- Specified by:
isValidin interfaceSaTokenContext- Returns:
- /
-
getModelBox
Description copied from interface:SaTokenContext获取 Box 对象- Specified by:
getModelBoxin interfaceSaTokenContext
-