本文整理汇总了Java中com.github.benmanes.caffeine.cache.RemovalCause类的典型用法代码示例。如果您正苦于以下问题:Java RemovalCause类的具体用法?Java RemovalCause怎么用?Java RemovalCause使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RemovalCause类属于com.github.benmanes.caffeine.cache包,在下文中一共展示了RemovalCause类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onRemoval
import com.github.benmanes.caffeine.cache.RemovalCause; //导入依赖的package包/类
@Override
public void onRemoval(K key, V value, RemovalCause cause) {
if (cause.wasEvicted()) {
evicted.incrementAndGet();
LOG.trace("onRemoval {} -> {}", key, value);
if (stopOnEviction) {
try {
// stop service as its evicted from cache
ServiceHelper.stopService(value);
} catch (Exception e) {
LOG.warn("Error stopping service: " + value + ". This exception will be ignored.", e);
}
}
}
}
开发者ID:HydAu,项目名称:Camel,代码行数:16,代码来源:LRUCache.java
示例2: processRemoval
import com.github.benmanes.caffeine.cache.RemovalCause; //导入依赖的package包/类
private void processRemoval(@Nullable ParticleEffect key, @Nullable ICachedMessage value, RemovalCause cause) {
if (value instanceof CachedFireworksMessage) {
final ByteBufParameterList parameterList = (ByteBufParameterList) ((CachedFireworksMessage) value)
.entityMetadataMessage.getParameterList();
parameterList.getByteBuffer().ifPresent(ByteBuffer::release);
}
}
开发者ID:LanternPowered,项目名称:LanternServer,代码行数:8,代码来源:ProcessorPlayOutParticleEffect.java
示例3: onRemoval
import com.github.benmanes.caffeine.cache.RemovalCause; //导入依赖的package包/类
@Override
public void onRemoval(@Nullable String key, @Nullable Object value, @Nonnull RemovalCause cause) {
if (cause.wasEvicted()) {
Jboot.me().getCache().removeAll(key);
}
}
开发者ID:yangfuhai,项目名称:jboot,代码行数:7,代码来源:JbootCacheSessionWapper.java
示例4: onRemoval
import com.github.benmanes.caffeine.cache.RemovalCause; //导入依赖的package包/类
@Override
public void onRemoval(String key, InstrumentedChannel value, RemovalCause cause) {
value.shutdownNow();
}
开发者ID:benson-git,项目名称:ibole-microservice,代码行数:5,代码来源:ChannelPool.java
示例5: onRemoval
import com.github.benmanes.caffeine.cache.RemovalCause; //导入依赖的package包/类
@Override
public void onRemoval(Object key, Object value, RemovalCause cause) {
LOG.info("Key %s was removed (%s)%n", key, cause);
}
开发者ID:wildfly-extras,项目名称:wildfly-camel,代码行数:5,代码来源:CaffeineCacheIntegrationTest.java
注:本文中的com.github.benmanes.caffeine.cache.RemovalCause类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论