本文整理汇总了Java中org.apache.shiro.mgt.DefaultSessionStorageEvaluator类的典型用法代码示例。如果您正苦于以下问题:Java DefaultSessionStorageEvaluator类的具体用法?Java DefaultSessionStorageEvaluator怎么用?Java DefaultSessionStorageEvaluator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DefaultSessionStorageEvaluator类属于org.apache.shiro.mgt包,在下文中一共展示了DefaultSessionStorageEvaluator类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getManager
import org.apache.shiro.mgt.DefaultSessionStorageEvaluator; //导入依赖的package包/类
@Bean("securityManager")
public DefaultWebSecurityManager getManager(Realm realm) {
DefaultWebSecurityManager manager = new DefaultWebSecurityManager();
manager.setRealm(realm);
DefaultSubjectDAO subjectDAO = new DefaultSubjectDAO();
DefaultSessionStorageEvaluator evaluator = new DefaultSessionStorageEvaluator();
evaluator.setSessionStorageEnabled(false);
subjectDAO.setSessionStorageEvaluator(evaluator);
manager.setSubjectDAO(subjectDAO);
return manager;
}
开发者ID:Eagle-OJ,项目名称:eagle-oj-api,代码行数:14,代码来源:ShiroConfig.java
示例2: securityManager
import org.apache.shiro.mgt.DefaultSessionStorageEvaluator; //导入依赖的package包/类
@Bean(name = "securityManager")
@ConditionalOnMissingBean
public DefaultSecurityManager securityManager(CacheManager shiroCacheManager) {
DefaultWebSecurityManager dwsm = new DefaultWebSecurityManager();
// 用自己的Factory实现替换默认
// 用于关闭session功能
dwsm.setSubjectFactory(new StatelessSubjectFactory());
dwsm.setSessionManager(defaultSessionManager());
// 关闭session存储
((DefaultSessionStorageEvaluator) ((DefaultSubjectDAO)dwsm.getSubjectDAO()).getSessionStorageEvaluator()).setSessionStorageEnabled(false);
// <!-- 用户授权/认证信息Cache, 采用EhCache 缓存 -->
dwsm.setCacheManager(shiroCacheManager);
SecurityUtils.setSecurityManager(dwsm);
return dwsm;
}
开发者ID:wanghongfei,项目名称:shiro-spring-boot-starter,代码行数:19,代码来源:ShiroManager.java
示例3: StalessSecurityManager
import org.apache.shiro.mgt.DefaultSessionStorageEvaluator; //导入依赖的package包/类
public StalessSecurityManager() {
setSubjectFactory(new StalessSubjectFactory()) ;
// Disabling Subject State Session Storage
// https://shiro.apache.org/session-management.html#disabling-subject-state-session-storage
DefaultSubjectDAO subjectDAO = (DefaultSubjectDAO)this.getSubjectDAO() ;
DefaultSessionStorageEvaluator sessionStorageEvaluator = (DefaultSessionStorageEvaluator)subjectDAO.getSessionStorageEvaluator() ;
sessionStorageEvaluator.setSessionStorageEnabled(false) ;
this.setRememberMeManager(null) ;
}
开发者ID:auslides,项目名称:stateless-shiro,代码行数:11,代码来源:StalessSecurityManager.java
示例4: SessionlessSecurityManager
import org.apache.shiro.mgt.DefaultSessionStorageEvaluator; //导入依赖的package包/类
/**
* Constructs a new session-less security manager.
*/
public SessionlessSecurityManager() {
super();
DefaultSubjectDAO subjectDAO = new DefaultSubjectDAO();
DefaultSessionStorageEvaluator sessionStorageEvaluator = new DefaultSessionStorageEvaluator();
sessionStorageEvaluator.setSessionStorageEnabled(false);
subjectDAO.setSessionStorageEvaluator(sessionStorageEvaluator);
setSubjectDAO(subjectDAO);
}
开发者ID:litesolutions,项目名称:scm-ssh-plugin,代码行数:12,代码来源:SessionlessSecurityManager.java
示例5: init
import org.apache.shiro.mgt.DefaultSessionStorageEvaluator; //导入依赖的package包/类
@Override
public void init() {
if (LOG.isTraceEnabled()) {
LOG.trace("Initializing the '" + getClass().getSimpleName()
+ "' using the default settings.");
}
// use the default realm
final MapDbAuthorizingRealm realm = new MapDbAuthorizingRealm(
handler.getDefaultLocation(true));
if (realm instanceof Initializable) {
realm.init();
}
// create a default manager and set it
final DefaultSecurityManager manager = new DefaultSecurityManager();
manager.setRealm(realm);
// get the manager and initialize it
if (manager instanceof Initializable) {
((Initializable) manager).init();
}
this.manager = manager;
final SessionManager sessionManager = this.manager.getSessionManager();
if (sessionManager instanceof AbstractValidatingSessionManager) {
((AbstractValidatingSessionManager) sessionManager)
.setSessionValidationSchedulerEnabled(false);
}
final SubjectDAO subjectDao = this.manager.getSubjectDAO();
if (subjectDao instanceof DefaultSubjectDAO) {
final SessionStorageEvaluator sessionStorageEvaluator = ((DefaultSubjectDAO) this.manager
.getSubjectDAO()).getSessionStorageEvaluator();
if (sessionStorageEvaluator instanceof DefaultSessionStorageEvaluator) {
((DefaultSessionStorageEvaluator) sessionStorageEvaluator)
.setSessionStorageEnabled(false);
}
}
this.builder = new Subject.Builder(manager);
this.builder.sessionCreationEnabled(false);
}
开发者ID:pmeisen,项目名称:dis-timeintervaldataanalyzer,代码行数:43,代码来源:ShiroAuthManager.java
注:本文中的org.apache.shiro.mgt.DefaultSessionStorageEvaluator类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论