net.sf.ehcache.Cache.getInternalContext()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(98)

本文整理了Java中net.sf.ehcache.Cache.getInternalContext()方法的一些代码示例,展示了Cache.getInternalContext()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Cache.getInternalContext()方法的具体详情如下:
包路径:net.sf.ehcache.Cache
类名称:Cache
方法名:getInternalContext

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 {

相关文章

微信公众号

最新文章

更多

Cache类方法