org.apache.shiro.cache.MemoryConstrainedCacheManager Java Examples

The following examples show how to use org.apache.shiro.cache.MemoryConstrainedCacheManager. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ShiroConfiguration.java    From spring-boot-shiro with Apache License 2.0 5 votes vote down vote up
/**
 * (基于内存的)用户授权信息Cache
 */
@Bean(name = "cacheManager")
@ConditionalOnMissingBean(name = "cacheManager")
@ConditionalOnMissingClass(value = {"org.apache.shiro.cache.ehcache.EhCacheManager"})
public CacheManager cacheManager() {
    return new MemoryConstrainedCacheManager();
}
 
Example #2
Source File: SecurityModule.java    From arcusplatform with Apache License 2.0 4 votes vote down vote up
protected void bindCacheManager(AnnotatedBindingBuilder<CacheManager> bind) {
   bind.to(MemoryConstrainedCacheManager.class);
}
 
Example #3
Source File: ShiroManager.java    From shiro-spring-boot-starter with Apache License 2.0 4 votes vote down vote up
/**
 * 用户授权信息Cache
 */
@Bean(name = "shiroCacheManager")
@ConditionalOnMissingBean
public CacheManager cacheManager() {
	return new MemoryConstrainedCacheManager();
}
 
Example #4
Source File: ShiroConfiguration.java    From utils with Apache License 2.0 4 votes vote down vote up
@Bean(name = "cacheManager")
@ConditionalOnMissingBean(name = "cacheManager")
public CacheManager cacheManager() {
    return new MemoryConstrainedCacheManager();
}
 
Example #5
Source File: ShiroManager.java    From shiro-spring-boot with Apache License 2.0 4 votes vote down vote up
/**
 * 用户授权信息Cache
 */
@Bean(name = "shiroCacheManager")
@ConditionalOnMissingBean
public CacheManager cacheManager() {
	return new MemoryConstrainedCacheManager();
}
 
Example #6
Source File: ShiroConfig.java    From EasyReport with Apache License 2.0 4 votes vote down vote up
@Bean
public MemoryConstrainedCacheManager cacheManager() {
    return new MemoryConstrainedCacheManager();
}
 
Example #7
Source File: ShiroRealm.java    From usergrid with Apache License 2.0 4 votes vote down vote up
public ShiroRealm() {
    super( new MemoryConstrainedCacheManager(), new SimpleCredentialsMatcher() );
}
 
Example #8
Source File: ShiroConfig.java    From SpringBoot-Base-System with GNU Lesser General Public License v3.0 2 votes vote down vote up
/**
 * 用户授权信息Cache
 * 
 * @time 2018年4月10日 下午5:09:52.
 * @version V1.0
 * @return CacheManager
 */
@Bean(name = "shiroCacheManager")
@ConditionalOnMissingBean
public CacheManager cacheManager() {
	return new MemoryConstrainedCacheManager();
}
 
Example #9
Source File: ShiroConfig.java    From wetech-admin with MIT License 2 votes vote down vote up
/**
 * 在生产环境中使用的基于简单内存的CacheManager @link CacheManager}实现。它不会导致内存泄漏,因为它会产生{@link Cache Cache}s,
 * 由{@link SoftHashMap SoftHashMap}s支持,
 * 后者根据运行时环境的内存*限制和垃圾收集行为自动调整大小。
 * 此处根据实际情况可以替换成ehcache、redis等实现
 *
 * @return
 */
@Bean
public MemoryConstrainedCacheManager cacheManager() {
    return new MemoryConstrainedCacheManager();
}