本文整理了Java中net.sf.ehcache.Cache.isDisabled()
方法的一些代码示例,展示了Cache.isDisabled()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Cache.isDisabled()
方法的具体详情如下:
包路径:net.sf.ehcache.Cache
类名称:Cache
方法名:isDisabled
[英]Whether this cache is disabled. "Disabled" means:
You can disable and enable a cache programmatically through the #setDisabled(boolean) method.
By default caches are enabled on creation, unless the net.sf.ehcache.disabled
system property is set.
[中]是否禁用此缓存。“残疾”是指:
1.已禁用引导
1.放弃看跌期权
1.丢弃无用的东西
1.返回null
在所有其他方面,缓存都会保持原样。
您可以通过#setDisabled(boolean)方法以编程方式禁用和启用缓存。
默认情况下,缓存在创建时启用,除非设置了net.sf.ehcache.disabled
系统属性。
代码示例来源:origin: net.sf.ehcache/ehcache
/**
* {@inheritDoc}
*/
public boolean isRegionCacheEnabled(String region) {
Cache cache = this.cacheManager.getCache(region);
if (cache != null) {
return !cache.isDisabled();
} else {
return false;
}
}
代码示例来源:origin: net.sf.ehcache/ehcache
/**
* {@inheritDoc}
*/
public boolean isRegionCachesEnabled() {
for (String name : this.cacheManager.getCacheNames()) {
Cache cache = this.cacheManager.getCache(name);
if (cache != null) {
if (cache.isDisabled()) {
return false;
}
}
}
return true;
}
代码示例来源:origin: net.sf.ehcache/ehcache
/**
* Disables or enables this cache. This call overrides the previous value of disabled, even if the
* <code>net.sf.ehcache.disabled</code> system property is set
*
* @param disabled true if you wish to disable, false to enable
* @see #isDisabled()
*/
public void setDisabled(boolean disabled) {
if (allowDisable) {
boolean oldValue = isDisabled();
if (oldValue != disabled) {
synchronized (this) {
this.disabled = disabled;
}
firePropertyChange("Disabled", oldValue, disabled);
}
} else {
throw new CacheException("Dynamic cache features are disabled");
}
}
代码示例来源:origin: org.sonatype.nexus.bundles/org.sonatype.nexus.bundles.ehcache
/**
* {@inheritDoc}
*/
public boolean isRegionCacheEnabled(String region) {
Cache cache = this.cacheManager.getCache(region);
if (cache != null) {
return !cache.isDisabled();
} else {
return false;
}
}
代码示例来源:origin: net.sf.ehcache.internal/ehcache-core
/**
* {@inheritDoc}
*/
public boolean isRegionCacheEnabled(String region) {
Cache cache = this.cacheManager.getCache(region);
if (cache != null) {
return !cache.isDisabled();
} else {
return false;
}
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache
/**
* {@inheritDoc}
*/
public boolean isRegionCacheEnabled(String region) {
Cache cache = this.cacheManager.getCache(region);
if (cache != null) {
return !cache.isDisabled();
} else {
return false;
}
}
代码示例来源:origin: net.sf.ehcache.internal/ehcache-core
/**
* {@inheritDoc}
*/
public boolean isRegionCachesEnabled() {
for (String name : this.cacheManager.getCacheNames()) {
Cache cache = this.cacheManager.getCache(name);
if (cache != null) {
if (cache.isDisabled()) {
return false;
}
}
}
return true;
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache
/**
* {@inheritDoc}
*/
public boolean isRegionCachesEnabled() {
for (String name : this.cacheManager.getCacheNames()) {
Cache cache = this.cacheManager.getCache(name);
if (cache != null) {
if (cache.isDisabled()) {
return false;
}
}
}
return true;
}
代码示例来源:origin: org.sonatype.nexus.bundles/org.sonatype.nexus.bundles.ehcache
/**
* {@inheritDoc}
*/
public boolean isRegionCachesEnabled() {
for (String name : this.cacheManager.getCacheNames()) {
Cache cache = this.cacheManager.getCache(name);
if (cache != null) {
if (cache.isDisabled()) {
return false;
}
}
}
return true;
}
代码示例来源:origin: net.sf.ehcache.internal/ehcache-core
/**
* Disables or enables this cache. This call overrides the previous value of disabled, even if the
* <code>net.sf.ehcache.disabled</code> system property is set
*
* @param disabled true if you wish to disable, false to enable
* @see #isDisabled()
*/
public void setDisabled(boolean disabled) {
if (allowDisable) {
boolean oldValue = isDisabled();
if (oldValue != disabled) {
synchronized (this) {
this.disabled = disabled;
}
firePropertyChange("Disabled", oldValue, disabled);
}
} else {
throw new CacheException("Dynamic cache features are disabled");
}
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache
/**
* Disables or enables this cache. This call overrides the previous value of disabled, even if the
* <code>net.sf.ehcache.disabled</code> system property is set
* <p/>
*
* @param disabled true if you wish to disable, false to enable
* @see #isDisabled()
*/
public void setDisabled(boolean disabled) {
if (allowDisable) {
boolean oldValue = isDisabled();
if (oldValue != disabled) {
synchronized (this) {
this.disabled = disabled;
}
firePropertyChange("Disabled", oldValue, disabled);
}
} else {
throw new CacheException("Dynamic cache features are disabled");
}
}
代码示例来源:origin: org.sonatype.nexus.bundles/org.sonatype.nexus.bundles.ehcache
/**
* Disables or enables this cache. This call overrides the previous value of disabled, even if the
* <code>net.sf.ehcache.disabled</code> system property is set
* <p/>
*
* @param disabled true if you wish to disable, false to enable
* @see #isDisabled()
*/
public void setDisabled(boolean disabled) {
if (allowDisable) {
boolean oldValue = isDisabled();
if (oldValue != disabled) {
synchronized (this) {
this.disabled = disabled;
}
firePropertyChange("Disabled", oldValue, disabled);
}
} else {
throw new CacheException("Dynamic cache features are disabled");
}
}
内容来源于网络,如有侵权,请联系作者删除!