本文整理汇总了Java中com.google.common.base.FinalizableReferenceQueue类的典型用法代码示例。如果您正苦于以下问题:Java FinalizableReferenceQueue类的具体用法?Java FinalizableReferenceQueue怎么用?Java FinalizableReferenceQueue使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FinalizableReferenceQueue类属于com.google.common.base包,在下文中一共展示了FinalizableReferenceQueue类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: SimpleRegistry
import com.google.common.base.FinalizableReferenceQueue; //导入依赖的package包/类
SimpleRegistry(WatchableRegistrationContainer registrationContainer, long timeout, TimeUnit unit) {
referenceQueue = new FinalizableReferenceQueue();
this.registrationContainer = registrationContainer;
//TODO test performance of the linked vs. array or any other blocking. may provide a new builder feature to setup the size of the queue
registryActionQueue = new LinkedBlockingQueue<>();
Thread registryActionThread = new Thread(new RegistryActionHandler(registryActionQueue), "yar-action-handler");
registryActionThread.setDaemon(true);
registryActionThread.start();
this.defaultTimeOut = timeout;
this.defaultTimeoutUnit = unit;
}
示例2: GuavaObjectCache
import com.google.common.base.FinalizableReferenceQueue; //导入依赖的package包/类
GuavaObjectCache(final FinalizableReferenceQueue queue) {
super(CacheBuilder.newBuilder().softValues().build(), queue);
}
示例3: SoftKey
import com.google.common.base.FinalizableReferenceQueue; //导入依赖的package包/类
public SoftKey(final T referent, final FinalizableReferenceQueue queue) {
super(requireNonNull(referent), queue);
hashCode = referent.hashCode();
}
示例4: AbstractObjectCache
import com.google.common.base.FinalizableReferenceQueue; //导入依赖的package包/类
protected AbstractObjectCache(final Cache<SoftKey<?>, Object> cache, final FinalizableReferenceQueue queue) {
this.queue = requireNonNull(queue);
this.cache = requireNonNull(cache);
}
示例5: setUp
import com.google.common.base.FinalizableReferenceQueue; //导入依赖的package包/类
@Before
public void setUp() {
queue = new FinalizableReferenceQueue();
oc = new AbstractObjectCache(CacheBuilder.newBuilder().softValues().build(), queue) {
};
}
示例6: setUp
import com.google.common.base.FinalizableReferenceQueue; //导入依赖的package包/类
@Before
public void setUp() {
queue = new FinalizableReferenceQueue();
}
示例7: newWatcherRegistration
import com.google.common.base.FinalizableReferenceQueue; //导入依赖的package包/类
static <T> WatcherRegistration<T> newWatcherRegistration(IdMatcher<T> leftValue, SupplierListener supplierListener, FinalizableReferenceQueue referenceQueue, Registry registry) {
return new WatcherRegistration<>(leftValue, supplierListener, new SupplierWatcherToSupplierListenerAdapter<T>(supplierListener), referenceQueue, registry);
}
示例8: WatcherRegistration
import com.google.common.base.FinalizableReferenceQueue; //导入依赖的package包/类
WatcherRegistration(IdMatcher<T> leftValue, Object weakReference, Watcher<T> rightValue, FinalizableReferenceQueue referenceQueue, Registry registry) {
super(weakReference, referenceQueue);
left = leftValue;
right = rightValue;
this.registry = registry;
}