Search in sources :

Example 1 with EhCacheManager

use of org.apache.shiro.cache.ehcache.EhCacheManager in project tesla by linking12.

the class AuthzConfig method getEhCacheManager.

@Bean
public EhCacheManager getEhCacheManager() {
    EhCacheManager em = new EhCacheManager();
    em.setCacheManagerConfigFile("classpath:config/ehcache.xml");
    return em;
}
Also used : EhCacheManager(org.apache.shiro.cache.ehcache.EhCacheManager) InitializingBean(org.springframework.beans.factory.InitializingBean) ShiroFilterFactoryBean(org.apache.shiro.spring.web.ShiroFilterFactoryBean) Bean(org.springframework.context.annotation.Bean)

Example 2 with EhCacheManager

use of org.apache.shiro.cache.ehcache.EhCacheManager in project moon by gentoo111.

the class EhcacheConfig method cacheManager.

@Bean("ehCacheManager")
public EhCacheManager cacheManager() {
    EhCacheManager cacheManager = new EhCacheManager();
    cacheManager.setCacheManagerConfigFile("classpath:ehcache.xml");
    return cacheManager;
}
Also used : EhCacheManager(org.apache.shiro.cache.ehcache.EhCacheManager) Bean(org.springframework.context.annotation.Bean)

Example 3 with EhCacheManager

use of org.apache.shiro.cache.ehcache.EhCacheManager in project vip by guangdada.

the class ShiroConfig method getCacheShiroManager.

/**
 * 缓存管理器 使用Ehcache实现
 */
@Bean
public CacheManager getCacheShiroManager(EhCacheManagerFactoryBean ehcache) {
    EhCacheManager ehCacheManager = new EhCacheManager();
    ehCacheManager.setCacheManager(ehcache.getObject());
    return ehCacheManager;
}
Also used : EhCacheManager(org.apache.shiro.cache.ehcache.EhCacheManager) ShiroFilterFactoryBean(org.apache.shiro.spring.web.ShiroFilterFactoryBean) MethodInvokingFactoryBean(org.springframework.beans.factory.config.MethodInvokingFactoryBean) EhCacheManagerFactoryBean(org.springframework.cache.ehcache.EhCacheManagerFactoryBean) Bean(org.springframework.context.annotation.Bean)

Example 4 with EhCacheManager

use of org.apache.shiro.cache.ehcache.EhCacheManager in project mica2 by obiba.

the class SecurityManagerFactory method initializeCacheManager.

private void initializeCacheManager(DefaultWebSecurityManager dsm) {
    if (dsm.getCacheManager() == null) {
        EhCacheManager ehCacheManager = new EhCacheManager();
        ehCacheManager.setCacheManager(cacheManager);
        dsm.setCacheManager(ehCacheManager);
    }
}
Also used : EhCacheManager(org.apache.shiro.cache.ehcache.EhCacheManager)

Example 5 with EhCacheManager

use of org.apache.shiro.cache.ehcache.EhCacheManager in project killbill by killbill.

the class EhCacheManagerProvider method get.

@Override
public EhCacheManager get() {
    final EhCacheManager shiroEhCacheManager = new EhCacheManager();
    // Same EhCache manager instance as the rest of the system
    shiroEhCacheManager.setCacheManager(ehCacheCacheManager);
    if (securityManager instanceof DefaultSecurityManager) {
        // For RBAC only (see also KillbillJdbcTenantRealmProvider)
        ((DefaultSecurityManager) securityManager).setCacheManager(shiroEhCacheManager);
    }
    return shiroEhCacheManager;
}
Also used : EhCacheManager(org.apache.shiro.cache.ehcache.EhCacheManager) DefaultSecurityManager(org.apache.shiro.mgt.DefaultSecurityManager)

Aggregations

EhCacheManager (org.apache.shiro.cache.ehcache.EhCacheManager)6 Bean (org.springframework.context.annotation.Bean)4 ShiroFilterFactoryBean (org.apache.shiro.spring.web.ShiroFilterFactoryBean)3 DefaultSecurityManager (org.apache.shiro.mgt.DefaultSecurityManager)1 InitializingBean (org.springframework.beans.factory.InitializingBean)1 MethodInvokingFactoryBean (org.springframework.beans.factory.config.MethodInvokingFactoryBean)1 EhCacheManagerFactoryBean (org.springframework.cache.ehcache.EhCacheManagerFactoryBean)1