Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
SSSDNSY
spring-framework
提交
81057a2c
S
spring-framework
项目概览
SSSDNSY
/
spring-framework
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
spring-framework
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
81057a2c
编写于
7月 04, 2016
作者:
J
Juergen Hoeller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Require EhCache 2.10+
Issue: SPR-13794
上级
44783546
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
2 addition
and
42 deletion
+2
-42
spring-context-support/src/main/java/org/springframework/cache/ehcache/EhCacheFactoryBean.java
...org/springframework/cache/ehcache/EhCacheFactoryBean.java
+1
-41
spring-context-support/src/main/java/org/springframework/cache/ehcache/EhCacheManagerFactoryBean.java
...ingframework/cache/ehcache/EhCacheManagerFactoryBean.java
+1
-1
未找到文件。
spring-context-support/src/main/java/org/springframework/cache/ehcache/EhCacheFactoryBean.java
浏览文件 @
81057a2c
/*
* Copyright 2002-201
4
the original author or authors.
* Copyright 2002-201
6
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -16,7 +16,6 @@
package
org.springframework.cache.ehcache
;
import
java.lang.reflect.Method
;
import
java.util.Set
;
import
net.sf.ehcache.Cache
;
...
...
@@ -37,8 +36,6 @@ import org.apache.commons.logging.LogFactory;
import
org.springframework.beans.factory.BeanNameAware
;
import
org.springframework.beans.factory.FactoryBean
;
import
org.springframework.beans.factory.InitializingBean
;
import
org.springframework.util.ClassUtils
;
import
org.springframework.util.ReflectionUtils
;
/**
* {@link FactoryBean} that creates a named EhCache {@link net.sf.ehcache.Cache} instance
...
...
@@ -64,15 +61,6 @@ import org.springframework.util.ReflectionUtils;
*/
public
class
EhCacheFactoryBean
extends
CacheConfiguration
implements
FactoryBean
<
Ehcache
>,
BeanNameAware
,
InitializingBean
{
// EhCache's setStatisticsEnabled(boolean) available? Not anymore as of EhCache 2.7...
private
static
final
Method
setStatisticsEnabledMethod
=
ClassUtils
.
getMethodIfAvailable
(
Ehcache
.
class
,
"setStatisticsEnabled"
,
boolean
.
class
);
// EhCache's setSampledStatisticsEnabled(boolean) available? Not anymore as of EhCache 2.7...
private
static
final
Method
setSampledStatisticsEnabledMethod
=
ClassUtils
.
getMethodIfAvailable
(
Ehcache
.
class
,
"setSampledStatisticsEnabled"
,
boolean
.
class
);
protected
final
Log
logger
=
LogFactory
.
getLog
(
getClass
());
private
CacheManager
cacheManager
;
...
...
@@ -195,26 +183,6 @@ public class EhCacheFactoryBean extends CacheConfiguration implements FactoryBea
this
.
cacheEventListeners
=
cacheEventListeners
;
}
/**
* Set whether to enable EhCache statistics on this cache.
* <p>Note: As of EhCache 2.7, statistics are enabled by default, and cannot be turned off.
* This setter therefore has no effect in such a scenario.
* @see net.sf.ehcache.Ehcache#setStatisticsEnabled
*/
public
void
setStatisticsEnabled
(
boolean
statisticsEnabled
)
{
this
.
statisticsEnabled
=
statisticsEnabled
;
}
/**
* Set whether to enable EhCache's sampled statistics on this cache.
* <p>Note: As of EhCache 2.7, statistics are enabled by default, and cannot be turned off.
* This setter therefore has no effect in such a scenario.
* @see net.sf.ehcache.Ehcache#setSampledStatisticsEnabled
*/
public
void
setSampledStatisticsEnabled
(
boolean
sampledStatisticsEnabled
)
{
this
.
sampledStatisticsEnabled
=
sampledStatisticsEnabled
;
}
/**
* Set whether this cache should be marked as disabled.
* @see net.sf.ehcache.Cache#setDisabled
...
...
@@ -276,14 +244,6 @@ public class EhCacheFactoryBean extends CacheConfiguration implements FactoryBea
this
.
cacheManager
.
addCache
(
rawCache
);
}
// Only necessary on EhCache <2.7: As of 2.7, statistics are on by default.
if
(
this
.
statisticsEnabled
&&
setStatisticsEnabledMethod
!=
null
)
{
ReflectionUtils
.
invokeMethod
(
setStatisticsEnabledMethod
,
rawCache
,
true
);
}
if
(
this
.
sampledStatisticsEnabled
&&
setSampledStatisticsEnabledMethod
!=
null
)
{
ReflectionUtils
.
invokeMethod
(
setSampledStatisticsEnabledMethod
,
rawCache
,
true
);
}
if
(
this
.
disabled
)
{
rawCache
.
setDisabled
(
true
);
}
...
...
spring-context-support/src/main/java/org/springframework/cache/ehcache/EhCacheManagerFactoryBean.java
浏览文件 @
81057a2c
...
...
@@ -41,7 +41,7 @@ import org.springframework.core.io.Resource;
* and cares for proper shutdown of the CacheManager. EhCacheManagerFactoryBean is
* also necessary for loading EhCache configuration from a non-default config location.
*
* <p>Note: As of Spring
4.1, Spring's EhCache support requires EhCache 2.5
or higher.
* <p>Note: As of Spring
5.0, Spring's EhCache support requires EhCache 2.10
or higher.
*
* @author Juergen Hoeller
* @author Dmitriy Kopylenko
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录