Shiro SessionsSecurityManager设计概念

SessionsSecurityManager

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

SessionManager

public interface SessionManager {

    // 创建Session
    Session start(SessionContext context);

    // 根据SessionKey获得Session
    Session getSession(SessionKey key) throws SessionException;
}

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

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

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

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

 

posted @ 2018-07-03 17:28  BINGJJFLY  阅读(532)  评论(0编辑  收藏  举报