com.google.common.cache.LocalCache.unset()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(6.3k)|赞(0)|评价(0)|浏览(85)

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

LocalCache.unset介绍

[英]Singleton placeholder that indicates a value is being loaded.
[中]指示正在加载值的单例占位符。

代码示例

代码示例来源:origin: google/guava

public LoadingValueReference(ValueReference<K, V> oldValue) {
 this.oldValue = (oldValue == null) ? LocalCache.<K, V>unset() : oldValue;
}

代码示例来源:origin: wildfly/wildfly

public LoadingValueReference(ValueReference<K, V> oldValue) {
 this.oldValue = (oldValue == null) ? LocalCache.<K, V>unset() : oldValue;
}

代码示例来源:origin: google/guava

@Override
public void notifyNewValue(@Nullable V newValue) {
 if (newValue != null) {
  // The pending load was clobbered by a manual write.
  // Unblock all pending gets, and have them return the new value.
  set(newValue);
 } else {
  // The pending load was removed. Delay notifications until loading completes.
  oldValue = unset();
 }
 // TODO(fry): could also cancel loading if we had a handle on its future
}

代码示例来源:origin: wildfly/wildfly

@Override
public void notifyNewValue(@NullableDecl V newValue) {
 if (newValue != null) {
  // The pending load was clobbered by a manual write.
  // Unblock all pending gets, and have them return the new value.
  set(newValue);
 } else {
  // The pending load was removed. Delay notifications until loading completes.
  oldValue = unset();
 }
 // TODO(fry): could also cancel loading if we had a handle on its future
}

代码示例来源:origin: com.diffplug.guava/guava-cache

public LoadingValueReference() {
  this(LocalCache.<K, V> unset());
}

代码示例来源:origin: org.jboss.eap/wildfly-client-all

public LoadingValueReference(ValueReference<K, V> oldValue) {
 this.oldValue = (oldValue == null) ? LocalCache.<K, V>unset() : oldValue;
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

public LoadingValueReference() {
 this(LocalCache.<K, V>unset());
}

代码示例来源:origin: Nextdoor/bender

public LoadingValueReference() {
 this(LocalCache.<K, V>unset());
}

代码示例来源:origin: org.sonatype.sisu/sisu-guava

public LoadingValueReference() {
 this(LocalCache.<K, V>unset());
}

代码示例来源:origin: com.diffplug.guava/guava-cache

@Override
public void notifyNewValue(@Nullable V newValue) {
  if (newValue != null) {
    // The pending load was clobbered by a manual write.
    // Unblock all pending gets, and have them return the new value.
    set(newValue);
  } else {
    // The pending load was removed. Delay notifications until loading completes.
    oldValue = unset();
  }
  // TODO(fry): could also cancel loading if we had a handle on its future
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/com.google.guava

@Override
public void notifyNewValue(@Nullable V newValue) {
 if (newValue != null) {
  // The pending load was clobbered by a manual write.
  // Unblock all pending gets, and have them return the new value.
  set(newValue);
 } else {
  // The pending load was removed. Delay notifications until loading completes.
  oldValue = unset();
 }
 // TODO(fry): could also cancel loading if we had a handle on its future
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

@Override
public void notifyNewValue(@Nullable V newValue) {
 if (newValue != null) {
  // The pending load was clobbered by a manual write.
  // Unblock all pending gets, and have them return the new value.
  set(newValue);
 } else {
  // The pending load was removed. Delay notifications until loading completes.
  oldValue = unset();
 }
 // TODO(fry): could also cancel loading if we had a handle on its future
}

代码示例来源:origin: com.google.guava/guava-jdk5

@Override
public void notifyNewValue(@Nullable V newValue) {
 if (newValue != null) {
  // The pending load was clobbered by a manual write.
  // Unblock all pending gets, and have them return the new value.
  set(newValue);
 } else {
  // The pending load was removed. Delay notifications until loading completes.
  oldValue = unset();
 }
 // TODO(fry): could also cancel loading if we had a handle on its future
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

@Override
public void notifyNewValue(@Nullable V newValue) {
 if (newValue != null) {
  // The pending load was clobbered by a manual write.
  // Unblock all pending gets, and have them return the new value.
  set(newValue);
 } else {
  // The pending load was removed. Delay notifications until loading completes.
  oldValue = unset();
 }
 // TODO(fry): could also cancel loading if we had a handle on its future
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-analytics

@Override
public void notifyNewValue(@Nullable V newValue) {
 if (newValue != null) {
  // The pending load was clobbered by a manual write.
  // Unblock all pending gets, and have them return the new value.
  set(newValue);
 } else {
  // The pending load was removed. Delay notifications until loading completes.
  oldValue = unset();
 }
 // TODO(fry): could also cancel loading if we had a handle on its future
}

代码示例来源:origin: Nextdoor/bender

@Override
public void notifyNewValue(@Nullable V newValue) {
 if (newValue != null) {
  // The pending load was clobbered by a manual write.
  // Unblock all pending gets, and have them return the new value.
  set(newValue);
 } else {
  // The pending load was removed. Delay notifications until loading completes.
  oldValue = unset();
 }
 // TODO(fry): could also cancel loading if we had a handle on its future
}

代码示例来源:origin: org.sonatype.sisu/sisu-guava

@Override
public void notifyNewValue(@Nullable V newValue) {
 if (newValue != null) {
  // The pending load was clobbered by a manual write.
  // Unblock all pending gets, and have them return the new value.
  set(newValue);
 } else {
  // The pending load was removed. Delay notifications until loading completes.
  oldValue = unset();
 }
 // TODO(fry): could also cancel loading if we had a handle on its future
}

代码示例来源:origin: org.hudsonci.lib.guava/guava

@Override
public void notifyNewValue(@Nullable V newValue) {
 if (newValue != null) {
  // The pending load was clobbered by a manual write.
  // Unblock all pending gets, and have them return the new value.
  set(newValue);
 } else {
  // The pending load was removed. Delay notifications until loading completes.
  oldValue = unset();
 }
 // TODO(fry): could also cancel loading if we had a handle on its future
}

代码示例来源:origin: org.jboss.eap/wildfly-client-all

@Override
public void notifyNewValue(@NullableDecl V newValue) {
 if (newValue != null) {
  // The pending load was clobbered by a manual write.
  // Unblock all pending gets, and have them return the new value.
  set(newValue);
 } else {
  // The pending load was removed. Delay notifications until loading completes.
  oldValue = unset();
 }
 // TODO(fry): could also cancel loading if we had a handle on its future
}

代码示例来源:origin: org.kill-bill.billing/killbill-platform-osgi-bundles-logger

@Override
public void notifyNewValue(@Nullable V newValue) {
 if (newValue != null) {
  // The pending load was clobbered by a manual write.
  // Unblock all pending gets, and have them return the new value.
  set(newValue);
 } else {
  // The pending load was removed. Delay notifications until loading completes.
  oldValue = unset();
 }
 // TODO(fry): could also cancel loading if we had a handle on its future
}

相关文章

微信公众号

最新文章

更多