security安全包應該是identity身份模塊中很重要的組成部分,其中主要包含以下類:
一、AuthenticatedUser認證用戶類:其中很簡單,就是gettter和setter 方法,設置和獲取authenticatedUser。
其中的authenticatedUser是一個ThreadLocal。
二、IdentityLoginModule身份登陸模塊類:
實現LoginModule接口。這個類和javax.security.auth.*等包結合非常緊密。
三、IdentityPolicy身份政策類:擴展Policy類。
四、IdentityService身份服務接口:驗證用戶和獲取User
五、Password和Usename JavaBean
------------------------------------------------------------
補充知識:
1.ThreadLocal
This class provides thread-local variables. These variables differ from their normal counterparts in that each thread that accesses one (via its get or set method) has its own, independently initialized copy of the variable. ThreadLocal instances are typically private static fields in classes that wish to associate state with a thread (e.g., a user ID or Transaction ID).
這支持支持thread-local 變量。這些變量不同于它們常用的對應物,在那每一個線程獲得一個(依靠get或set方法)擁有它自己的,獨立地初始化復制這個變量。ThreadLocal實例是典型地私有靜態字段,它希望聯系狀態使用線程(例如;一個用戶ID或事務ID)。
只有注冊用戶登錄后才能發表評論。 | ||
![]() |
||
網站導航:
博客園
IT新聞
Chat2DB
C++博客
博問
管理
|
||
相關文章:
|
||