本文整理了Java中net.sf.ehcache.Cache.getInternalContext()
方法的一些代码示例,展示了Cache.getInternalContext()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Cache.getInternalContext()
方法的具体详情如下:
包路径:net.sf.ehcache.Cache
类名称:Cache
方法名:getInternalContext
暂无
代码示例来源:origin: net.sf.ehcache/ehcache
Sync syncForKey = ((CacheLockProvider)getInternalContext()).getSyncForKey(key);
boolean writeLocked = false;
try {
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache
private void tryRemoveImmediately(final Object key, final boolean notifyListeners) {
Sync syncForKey = ((CacheLockProvider)getInternalContext()).getSyncForKey(key);
boolean writeLocked = false;
try {
writeLocked = syncForKey.tryLock(LockType.WRITE, 0);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
} catch (LockOperationTimedOutNonstopException e) {
if (LOG.isDebugEnabled()) {
LOG.debug("Try lock attempt failed, inline expiry will not happen. Exception: " + e);
}
} catch (Error e) {
if (!(e.getClass().getName().equals("com.tc.exception.TCLockUpgradeNotSupportedError"))) {
throw e;
}
}
if (writeLocked) {
try {
removeInternal(key, true, notifyListeners, false, false);
} finally {
syncForKey.unlock(LockType.WRITE);
}
} else {
if (LOG.isDebugEnabled()) {
LOG.debug(configuration.getName() + " cache: element " + key + " expired, but couldn't be inline evicted");
}
}
}
代码示例来源:origin: net.sf.ehcache.internal/ehcache-core
Sync syncForKey = ((CacheLockProvider)getInternalContext()).getSyncForKey(key);
boolean writeLocked = false;
try {
代码示例来源:origin: org.sonatype.nexus.bundles/org.sonatype.nexus.bundles.ehcache
Sync syncForKey = ((CacheLockProvider)getInternalContext()).getSyncForKey(key);
boolean writeLocked = false;
try {
内容来源于网络,如有侵权,请联系作者删除!