Shiro SessionsSecurityManager设计概念

SessionsSecurityManager

SessionsSecurityManager的具体行为就是实现SessionManager的抽象行为session

SessionManager

public interface SessionManager { // 建立Session
 Session start(SessionContext context); // 根据SessionKey得到Session
    Session getSession(SessionKey key) throws SessionException; }

SessionsSecurityManager内置了一个SessionManager会员管理器this

public Session start(SessionContext context) throws AuthorizationException { return this.sessionManager.start(context); } public Session getSession(SessionKey key) throws SessionException { return this.sessionManager.getSession(key); }

其设计理念是实现会员管理器接口,又用会员管理器去具体实现其定义的行为。spa

相关文章
相关标签/搜索