本文整理了Java中net.sf.ehcache.config.Configuration.isMaxBytesLocalOffHeapSet()
方法的一些代码示例,展示了Configuration.isMaxBytesLocalOffHeapSet()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Configuration.isMaxBytesLocalOffHeapSet()
方法的具体详情如下:
包路径:net.sf.ehcache.config.Configuration
类名称:Configuration
方法名:isMaxBytesLocalOffHeapSet
[英]Checks whether the user explicitly set the maxBytesOffHeat
[中]检查用户是否显式设置MaxByteOffheat
代码示例来源:origin: net.sf.ehcache/ehcache
/**
* Checks whether the CacheManager uses a OffHeapPool
* @return true if using one, false otherwise
*/
public boolean hasOffHeapPool() {
return isMaxBytesLocalOffHeapSet();
}
}
代码示例来源:origin: net.sf.ehcache/ehcache
/**
* Validates the CacheConfiguration against the CacheManager's Configuration
* @param configuration The CacheManager Configuration
* @return the list of errors encountered, or an empty list
*/
List<CacheConfigError> validateCachePools(final Configuration configuration) {
List<CacheConfigError> errors = new ArrayList<CacheConfigError>();
if (configuration.isMaxBytesLocalHeapSet()
&& getMaxEntriesLocalHeap() > 0) {
errors.add(new CacheConfigError("maxEntriesLocalHeap is not compatible with " +
"maxBytesLocalHeap set on cache manager", getName()));
}
if (getMaxBytesLocalHeap() > 0 && getMaxEntriesLocalHeap() > 0) {
errors.add(new CacheConfigError("maxEntriesLocalHeap is not compatible with " +
"maxBytesLocalHeap set on cache", getName()));
}
if (isMaxBytesLocalHeapPercentageSet() && !configuration.isMaxBytesLocalHeapSet()) {
errors.add(new CacheConfigError("Defines a percentage maxBytesOnHeap value but no CacheManager " +
"wide value was configured", getName()));
}
if (isMaxBytesLocalOffHeapPercentageSet() && !configuration.isMaxBytesLocalOffHeapSet()) {
errors.add(new CacheConfigError("Defines a percentage maxBytesOffHeap value but no CacheManager " +
"wide value was configured", getName()));
}
if (isMaxBytesLocalDiskPercentageSet() && !configuration.isMaxBytesLocalDiskSet()) {
errors.add(new CacheConfigError("Defines a percentage maxBytesOnDisk value but no CacheManager " +
"wide value was configured", getName()));
}
return errors;
}
代码示例来源:origin: net.sf.ehcache.internal/ehcache-core
/**
* Checks whether the CacheManager uses a OffHeapPool
* @return true if using one, false otherwise
*/
public boolean hasOffHeapPool() {
return isMaxBytesLocalOffHeapSet();
}
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache
/**
* Checks whether the CacheManager uses a OffHeapPool
* @return true if using one, false otherwise
*/
public boolean hasOffHeapPool() {
return isMaxBytesLocalOffHeapSet();
}
}
代码示例来源:origin: org.sonatype.nexus.bundles/org.sonatype.nexus.bundles.ehcache
/**
* Checks whether the CacheManager uses a OffHeapPool
* @return true if using one, false otherwise
*/
public boolean hasOffHeapPool() {
return isMaxBytesLocalOffHeapSet();
}
}
代码示例来源:origin: net.sf.ehcache/ehcache
private void freezePoolUsages(final CacheManager cacheManager) {
if (getMaxBytesLocalHeap() > 0) {
onHeapPoolUsage = CacheConfiguration.PoolUsage.Cache;
} else if (cacheManager.getConfiguration().isMaxBytesLocalHeapSet()) {
onHeapPoolUsage = CacheConfiguration.PoolUsage.CacheManager;
} else {
onHeapPoolUsage = CacheConfiguration.PoolUsage.None;
}
if (getMaxBytesLocalOffHeap() > 0) {
offHeapPoolUsage = CacheConfiguration.PoolUsage.Cache;
} else if (cacheManager.getConfiguration().isMaxBytesLocalOffHeapSet()) {
offHeapPoolUsage = CacheConfiguration.PoolUsage.CacheManager;
} else {
offHeapPoolUsage = CacheConfiguration.PoolUsage.None;
}
if (isTerracottaClustered()) {
onDiskPoolUsage = CacheConfiguration.PoolUsage.None;
} else {
if (getMaxBytesLocalDisk() > 0) {
onDiskPoolUsage = CacheConfiguration.PoolUsage.Cache;
} else if (cacheManager.getConfiguration().isMaxBytesLocalDiskSet()) {
onDiskPoolUsage = CacheConfiguration.PoolUsage.CacheManager;
} else {
onDiskPoolUsage = CacheConfiguration.PoolUsage.None;
}
}
}
代码示例来源:origin: net.sf.ehcache/ehcache
if (overflowToOffHeap == null && (cacheManager.getConfiguration().isMaxBytesLocalOffHeapSet() || getMaxBytesLocalOffHeap() > 0)) {
overflowToOffHeap = true;
代码示例来源:origin: net.sf.ehcache.internal/ehcache-core
/**
* Validates the CacheConfiguration against the CacheManager's Configuration
* @param configuration The CacheManager Configuration
* @return the list of errors encountered, or an empty list
*/
List<CacheConfigError> validateCachePools(final Configuration configuration) {
List<CacheConfigError> errors = new ArrayList<CacheConfigError>();
if (configuration.isMaxBytesLocalHeapSet()
&& getMaxEntriesLocalHeap() > 0) {
errors.add(new CacheConfigError("maxEntriesLocalHeap is not compatible with " +
"maxBytesLocalHeap set on cache manager", getName()));
}
if (getMaxBytesLocalHeap() > 0 && getMaxEntriesLocalHeap() > 0) {
errors.add(new CacheConfigError("maxEntriesLocalHeap is not compatible with " +
"maxBytesLocalHeap set on cache", getName()));
}
if (isMaxBytesLocalHeapPercentageSet() && !configuration.isMaxBytesLocalHeapSet()) {
errors.add(new CacheConfigError("Defines a percentage maxBytesOnHeap value but no CacheManager " +
"wide value was configured", getName()));
}
if (isMaxBytesLocalOffHeapPercentageSet() && !configuration.isMaxBytesLocalOffHeapSet()) {
errors.add(new CacheConfigError("Defines a percentage maxBytesOffHeap value but no CacheManager " +
"wide value was configured", getName()));
}
if (isMaxBytesLocalDiskPercentageSet() && !configuration.isMaxBytesLocalDiskSet()) {
errors.add(new CacheConfigError("Defines a percentage maxBytesOnDisk value but no CacheManager " +
"wide value was configured", getName()));
}
return errors;
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache
/**
* Validates the CacheConfiguration against the CacheManager's Configuration
* @param configuration The CacheManager Configuration
* @return the list of errors encountered, or an empty list
*/
List<CacheConfigError> validateCachePools(final Configuration configuration) {
List<CacheConfigError> errors = new ArrayList<CacheConfigError>();
if (configuration.isMaxBytesLocalHeapSet()
&& getMaxEntriesLocalHeap() > 0) {
errors.add(new CacheConfigError("MaxElementsInMemory is not compatible with " +
"MaxBytesLocalHeap set on cache manager", getName()));
}
if (getMaxBytesLocalHeap() > 0 && getMaxEntriesLocalHeap() > 0) {
errors.add(new CacheConfigError("MaxElementsInMemory is not compatible with " +
"MaxBytesLocalHeap set on cache", getName()));
}
if (isMaxBytesLocalHeapPercentageSet() && !configuration.isMaxBytesLocalHeapSet()) {
errors.add(new CacheConfigError("Defines a percentage maxBytesOnHeap value but no CacheManager " +
"wide value was configured", getName()));
}
if (isMaxBytesLocalOffHeapPercentageSet() && !configuration.isMaxBytesLocalOffHeapSet()) {
errors.add(new CacheConfigError("Defines a percentage maxBytesOffHeap value but no CacheManager " +
"wide value was configured", getName()));
}
if (isMaxBytesLocalDiskPercentageSet() && !configuration.isMaxBytesLocalDiskSet()) {
errors.add(new CacheConfigError("Defines a percentage maxBytesOnDisk value but no CacheManager " +
"wide value was configured", getName()));
}
return errors;
}
代码示例来源:origin: org.sonatype.nexus.bundles/org.sonatype.nexus.bundles.ehcache
/**
* Validates the CacheConfiguration against the CacheManager's Configuration
* @param configuration The CacheManager Configuration
* @return the list of errors encountered, or an empty list
*/
List<CacheConfigError> validateCachePools(final Configuration configuration) {
List<CacheConfigError> errors = new ArrayList<CacheConfigError>();
if (configuration.isMaxBytesLocalHeapSet()
&& getMaxEntriesLocalHeap() > 0) {
errors.add(new CacheConfigError("maxEntriesLocalHeap is not compatible with " +
"maxBytesLocalHeap set on cache manager", getName()));
}
if (getMaxBytesLocalHeap() > 0 && getMaxEntriesLocalHeap() > 0) {
errors.add(new CacheConfigError("maxEntriesLocalHeap is not compatible with " +
"maxBytesLocalHeap set on cache", getName()));
}
if (isMaxBytesLocalHeapPercentageSet() && !configuration.isMaxBytesLocalHeapSet()) {
errors.add(new CacheConfigError("Defines a percentage maxBytesOnHeap value but no CacheManager " +
"wide value was configured", getName()));
}
if (isMaxBytesLocalOffHeapPercentageSet() && !configuration.isMaxBytesLocalOffHeapSet()) {
errors.add(new CacheConfigError("Defines a percentage maxBytesOffHeap value but no CacheManager " +
"wide value was configured", getName()));
}
if (isMaxBytesLocalDiskPercentageSet() && !configuration.isMaxBytesLocalDiskSet()) {
errors.add(new CacheConfigError("Defines a percentage maxBytesOnDisk value but no CacheManager " +
"wide value was configured", getName()));
}
return errors;
}
代码示例来源:origin: net.sf.ehcache.internal/ehcache-core
private void freezePoolUsages(final CacheManager cacheManager) {
if (getMaxBytesLocalHeap() > 0) {
onHeapPoolUsage = CacheConfiguration.PoolUsage.Cache;
} else if (cacheManager.getConfiguration().isMaxBytesLocalHeapSet()) {
onHeapPoolUsage = CacheConfiguration.PoolUsage.CacheManager;
} else {
onHeapPoolUsage = CacheConfiguration.PoolUsage.None;
}
if (getMaxBytesLocalOffHeap() > 0) {
offHeapPoolUsage = CacheConfiguration.PoolUsage.Cache;
} else if (cacheManager.getConfiguration().isMaxBytesLocalOffHeapSet()) {
offHeapPoolUsage = CacheConfiguration.PoolUsage.CacheManager;
} else {
offHeapPoolUsage = CacheConfiguration.PoolUsage.None;
}
if (isTerracottaClustered()) {
onDiskPoolUsage = CacheConfiguration.PoolUsage.None;
} else {
if (getMaxBytesLocalDisk() > 0) {
onDiskPoolUsage = CacheConfiguration.PoolUsage.Cache;
} else if (cacheManager.getConfiguration().isMaxBytesLocalDiskSet()) {
onDiskPoolUsage = CacheConfiguration.PoolUsage.CacheManager;
} else {
onDiskPoolUsage = CacheConfiguration.PoolUsage.None;
}
}
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache
private void freezePoolUsages(final CacheManager cacheManager) {
if (getMaxBytesLocalHeap() > 0) {
onHeapPoolUsage = CacheConfiguration.PoolUsage.Cache;
} else if (cacheManager.getConfiguration().isMaxBytesLocalHeapSet()) {
onHeapPoolUsage = CacheConfiguration.PoolUsage.CacheManager;
} else {
onHeapPoolUsage = CacheConfiguration.PoolUsage.None;
}
if (getMaxBytesLocalOffHeap() > 0) {
offHeapPoolUsage = CacheConfiguration.PoolUsage.Cache;
} else if (cacheManager.getConfiguration().isMaxBytesLocalOffHeapSet()) {
offHeapPoolUsage = CacheConfiguration.PoolUsage.CacheManager;
} else {
offHeapPoolUsage = CacheConfiguration.PoolUsage.None;
}
if (isTerracottaClustered()) {
onDiskPoolUsage = CacheConfiguration.PoolUsage.None;
} else {
if (getMaxBytesLocalDisk() > 0) {
onDiskPoolUsage = CacheConfiguration.PoolUsage.Cache;
} else if (cacheManager.getConfiguration().isMaxBytesLocalDiskSet()) {
onDiskPoolUsage = CacheConfiguration.PoolUsage.CacheManager;
} else {
onDiskPoolUsage = CacheConfiguration.PoolUsage.None;
}
}
}
代码示例来源:origin: org.sonatype.nexus.bundles/org.sonatype.nexus.bundles.ehcache
private void freezePoolUsages(final CacheManager cacheManager) {
if (getMaxBytesLocalHeap() > 0) {
onHeapPoolUsage = CacheConfiguration.PoolUsage.Cache;
} else if (cacheManager.getConfiguration().isMaxBytesLocalHeapSet()) {
onHeapPoolUsage = CacheConfiguration.PoolUsage.CacheManager;
} else {
onHeapPoolUsage = CacheConfiguration.PoolUsage.None;
}
if (getMaxBytesLocalOffHeap() > 0) {
offHeapPoolUsage = CacheConfiguration.PoolUsage.Cache;
} else if (cacheManager.getConfiguration().isMaxBytesLocalOffHeapSet()) {
offHeapPoolUsage = CacheConfiguration.PoolUsage.CacheManager;
} else {
offHeapPoolUsage = CacheConfiguration.PoolUsage.None;
}
if (isTerracottaClustered()) {
onDiskPoolUsage = CacheConfiguration.PoolUsage.None;
} else {
if (getMaxBytesLocalDisk() > 0) {
onDiskPoolUsage = CacheConfiguration.PoolUsage.Cache;
} else if (cacheManager.getConfiguration().isMaxBytesLocalDiskSet()) {
onDiskPoolUsage = CacheConfiguration.PoolUsage.CacheManager;
} else {
onDiskPoolUsage = CacheConfiguration.PoolUsage.None;
}
}
}
代码示例来源:origin: net.sf.ehcache.internal/ehcache-core
if (overflowToOffHeap == null && (cacheManager.getConfiguration().isMaxBytesLocalOffHeapSet() || getMaxBytesLocalOffHeap() > 0)) {
overflowToOffHeap = true;
代码示例来源:origin: org.sonatype.nexus.bundles/org.sonatype.nexus.bundles.ehcache
if (overflowToOffHeap == null && (cacheManager.getConfiguration().isMaxBytesLocalOffHeapSet() || getMaxBytesLocalOffHeap() > 0)) {
overflowToOffHeap = true;
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache
if (overflowToOffHeap == null && (cacheManager.getConfiguration().isMaxBytesLocalOffHeapSet() || getMaxBytesLocalOffHeap() > 0)) {
overflowToOffHeap = true;
内容来源于网络,如有侵权,请联系作者删除!