当前位置: 首页>>代码示例>>Java>>正文


Java EhCacheManager类代码示例

本文整理汇总了Java中org.apache.shiro.cache.ehcache.EhCacheManager的典型用法代码示例。如果您正苦于以下问题:Java EhCacheManager类的具体用法?Java EhCacheManager怎么用?Java EhCacheManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


EhCacheManager类属于org.apache.shiro.cache.ehcache包,在下文中一共展示了EhCacheManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getEhCacheManager

import org.apache.shiro.cache.ehcache.EhCacheManager; //导入依赖的package包/类
/**
 * 注入缓存
 * @return
 */
@Bean
public EhCacheManager getEhCacheManager() {
    EhCacheManager em = new EhCacheManager();
    em.setCacheManagerConfigFile("classpath:ehcache-shiro.xml");
    return em;
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:11,代码来源:ShiroCasConfiguration.java

示例2: myShiroCasRealm

import org.apache.shiro.cache.ehcache.EhCacheManager; //导入依赖的package包/类
@Bean(name = "myShiroCasRealm")
public MyShiroCasRealm myShiroCasRealm(EhCacheManager cacheManager) {
    MyShiroCasRealm realm = new MyShiroCasRealm();
    realm.setCacheManager(cacheManager);
    //realm.setCasServerUrlPrefix(ShiroCasConfiguration.casServerUrlPrefix);
    // 客户端回调地址
    //realm.setCasService(ShiroCasConfiguration.shiroServerUrlPrefix + ShiroCasConfiguration.casFilterUrlPattern);
    return realm;
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:10,代码来源:ShiroCasConfiguration.java

示例3: ehCacheManager

import org.apache.shiro.cache.ehcache.EhCacheManager; //导入依赖的package包/类
/**
 * shiro缓存管理器;
 * 需要注入对应的其它的实体类中:
 * 安全管理器:securityManager
 */
@Bean
public EhCacheManager ehCacheManager(){
    System.out.println("ShiroConfiguration.getEhCacheManager()");
    EhCacheManager cacheManager = new EhCacheManager();
    cacheManager.setCacheManagerConfigFile("classpath:shiro/ehcache-shiro.xml");
    return cacheManager;
}
 
开发者ID:mmdsyl,项目名称:BLOG-Microservice,代码行数:13,代码来源:ShiroConfiguration.java

示例4: getDefaultWebSecurityManager

import org.apache.shiro.cache.ehcache.EhCacheManager; //导入依赖的package包/类
@Bean(name = "securityManager")
    public DefaultWebSecurityManager getDefaultWebSecurityManager(
            SystemAuthorizingRealm myShiroRealm,
            DefaultWebSessionManager sessionManager,
            EhCacheManager shiroCacheManager) {
        DefaultWebSecurityManager dwsm = new DefaultWebSecurityManager();
        dwsm.setRealm(myShiroRealm);
        dwsm.setSessionManager(sessionManager);
//      <!-- 用户授权/认证信息Cache, 采用EhCache 缓存 -->
        dwsm.setCacheManager(shiroCacheManager);
        return dwsm;
    }
 
开发者ID:egojit8,项目名称:easyweb,代码行数:13,代码来源:ShiroConfiguration.java

示例5: getSessionDAO

import org.apache.shiro.cache.ehcache.EhCacheManager; //导入依赖的package包/类
@Bean(name = "sessionDAO")
public SessionDAO getSessionDAO(IdGen idGen, EhCacheManager shiroCacheManager){
    CacheSessionDAO cacheSessionDAO=new CacheSessionDAO();
    cacheSessionDAO.setSessionIdGenerator(idGen);
    cacheSessionDAO.setActiveSessionsCacheName("activeSessionsCache");
    cacheSessionDAO.setCacheManager(shiroCacheManager);
    return cacheSessionDAO;
}
 
开发者ID:egojit8,项目名称:easyweb,代码行数:9,代码来源:ShiroConfiguration.java

示例6: ehcacheManager

import org.apache.shiro.cache.ehcache.EhCacheManager; //导入依赖的package包/类
@Bean(name = "cacheManager")
@ConditionalOnClass(name = {"org.apache.shiro.cache.ehcache.EhCacheManager"})
@ConditionalOnMissingBean(name = "cacheManager")
public CacheManager ehcacheManager() {
    EhCacheManager ehCacheManager = new EhCacheManager();
    ShiroProperties.Ehcache ehcache = properties.getEhcache();
    if (ehcache.getCacheManagerConfigFile() != null) {
        ehCacheManager.setCacheManagerConfigFile(ehcache.getCacheManagerConfigFile());
    }
    return ehCacheManager;
}
 
开发者ID:johntostring,项目名称:spring-boot-shiro,代码行数:12,代码来源:ShiroAutoConfiguration.java

示例7: ehcacheManager

import org.apache.shiro.cache.ehcache.EhCacheManager; //导入依赖的package包/类
@Bean(name = "cacheManager")
@ConditionalOnClass(name = {"org.apache.shiro.cache.ehcache.EhCacheManager"})
@ConditionalOnMissingBean(name = "cacheManager")
public CacheManager ehcacheManager() {
    EhCacheManager ehCacheManager = new EhCacheManager();

    ShiroProperties.Ehcache ehcache = shiroProperties.getEhcache();
    if (ehcache.getConfigFile() != null) {
        ehCacheManager.setCacheManagerConfigFile(ehcache.getConfigFile());
    }

    return ehCacheManager;
}
 
开发者ID:storezhang,项目名称:utils,代码行数:14,代码来源:ShiroAutoConfiguration.java

示例8: webSecurityManager

import org.apache.shiro.cache.ehcache.EhCacheManager; //导入依赖的package包/类
@Bean
public DefaultWebSecurityManager webSecurityManager(Realm realm,
                                                    CookieRememberMeManager rememberMeManager,
                                                    DefaultWebSessionManager sessionManager,
                                                    EhCacheManager ehCacheManager) {
    DefaultWebSecurityManager defaultWebSecurityManager = new DefaultWebSecurityManager();
    defaultWebSecurityManager.setRealm(realm);
    defaultWebSecurityManager.setRememberMeManager(rememberMeManager);
    defaultWebSecurityManager.setSessionManager(sessionManager);
    defaultWebSecurityManager.setCacheManager(ehCacheManager);
    return defaultWebSecurityManager;
}
 
开发者ID:izhangzhihao,项目名称:SpringMVCWithJavaConfig,代码行数:13,代码来源:ShiroConfig.java

示例9: initSecurityManager

import org.apache.shiro.cache.ehcache.EhCacheManager; //导入依赖的package包/类
private WebSecurityManager initSecurityManager() {
    AppDbRealm appDbRealm = new AppDbRealm();
    DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager(appDbRealm);
    final EhCacheManager cacheManager = new EhCacheManager();
    cacheManager.setCacheManagerConfigFile("classpath:goja/ehcache/shiro-ehcache.xml");
    securityManager.setCacheManager(cacheManager);
    final DefaultWebSessionManager defaultWebSessionManager = new DefaultWebSessionManager();
    defaultWebSessionManager.setSessionIdCookieEnabled(true);
    // 默认一年过期时间
    final String expiredTimes = shiroConfig.getProperty("session.expired", "10800000");
    defaultWebSessionManager.setGlobalSessionTimeout(MoreObjects.firstNonNull(Ints.tryParse(expiredTimes), 10800000));
    securityManager.setSessionManager(defaultWebSessionManager);
    return securityManager;
}
 
开发者ID:GojaFramework,项目名称:goja,代码行数:15,代码来源:GojaShiroFilter.java

示例10: initializeCacheManager

import org.apache.shiro.cache.ehcache.EhCacheManager; //导入依赖的package包/类
private void initializeCacheManager(DefaultSecurityManager dsm) {
  if(dsm.getCacheManager() == null) {
    EhCacheManager ehCacheManager = new EhCacheManager();
    ehCacheManager.setCacheManager(cacheManager);
    dsm.setCacheManager(ehCacheManager);
  }
}
 
开发者ID:obiba,项目名称:agate,代码行数:8,代码来源:SecurityManagerFactory.java

示例11: PersistenceRealm

import org.apache.shiro.cache.ehcache.EhCacheManager; //导入依赖的package包/类
/**
 * Constructor adds EhCacheManager.
 */
public PersistenceRealm() {
    super(
        new EhCacheManager());

    // set hashed credentials matcher
    HashedCredentialsMatcher credentialsMatcher = new HashedCredentialsMatcher(HASH_ALGORITHM);
    credentialsMatcher.setHashIterations(HASH_ITERATIONS);
    credentialsMatcher.setStoredCredentialsHexEncoded(false);
    setCredentialsMatcher(credentialsMatcher);
}
 
开发者ID:panifex,项目名称:panifex-platform,代码行数:14,代码来源:PersistenceRealm.java

示例12: securityManager

import org.apache.shiro.cache.ehcache.EhCacheManager; //导入依赖的package包/类
@Bean
public SecurityManager securityManager(net.sf.ehcache.CacheManager cacheManager, SessionManager sessionManager, MyRealm myRealm) {
    DefaultWebSecurityManager sm = new DefaultWebSecurityManager();
    registLoggingAuthenticationListener(sm);
    //
    EhCacheManager cm = new EhCacheManager();
    cm.setCacheManager(cacheManager);
    sm.setCacheManager(cm);
    sm.setSessionManager(sessionManager);
    // realm.
    Preconditions.checkNotNull(myRealm);
    sm.setRealm(myRealm);
    //
    return sm;
}
 
开发者ID:ageldama,项目名称:glados-wiki,代码行数:16,代码来源:ShiroContext.java

示例13: getShiroCacheManager

import org.apache.shiro.cache.ehcache.EhCacheManager; //导入依赖的package包/类
@Bean(name = "shiroCacheManager")
public EhCacheManager getShiroCacheManager(EhCacheManagerFactoryBean cacheManager) {
    EhCacheManager em = new EhCacheManager();
    em.setCacheManager(cacheManager.getObject());
    return em;
}
 
开发者ID:egojit8,项目名称:easyweb,代码行数:7,代码来源:ShiroConfiguration.java

示例14: ehCacheManager

import org.apache.shiro.cache.ehcache.EhCacheManager; //导入依赖的package包/类
@Bean(name = "ehcacheManager")
public EhCacheManager ehCacheManager(){
	EhCacheManager em = new EhCacheManager();
	em.setCacheManagerConfigFile("classpath:config/ehcache-shiro.xml");
	return em;
}
 
开发者ID:ranji1221,项目名称:lemcloud,代码行数:7,代码来源:ShiroConfig.java

示例15: getCacheManager

import org.apache.shiro.cache.ehcache.EhCacheManager; //导入依赖的package包/类
@Bean
public CacheManager getCacheManager() {
    return new EhCacheManager();
}
 
开发者ID:sisyphsu,项目名称:server-boilerplate,代码行数:5,代码来源:ShiroConfig.java


注:本文中的org.apache.shiro.cache.ehcache.EhCacheManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。