Top Fields Constructors Methods
org.newsclub.net.unix.pool

pack-priv final Class VirtualAwareThreadLocalObjectPool<O>

extends Object
implements ObjectPool<O>
Class Inheritance
All Implemented Interfaces
org.newsclub.net.unix.pool.ObjectPool
Imports
org.eclipse.jdt.annotation.NonNull, org.newsclub.net.unix.ThreadUtil

Field Summary

Modifier and TypeField and Description
private final ConcurrentQueueObjectPool<O>
private final ThreadLocalObjectPool<O>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public ObjectPool.Lease<O>
take()

Implements org.newsclub.net.unix.pool.ObjectPool.take.

Takes an exclusive lease of an object from the pool.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cqPoolback to summary
private final ConcurrentQueueObjectPool<O> cqPool
tlPoolback to summary
private final ThreadLocalObjectPool<O> tlPool

Constructor Detail

VirtualAwareThreadLocalObjectPoolback to summary
public VirtualAwareThreadLocalObjectPool(ObjectPool.ObjectSupplier<@NonNull O> supplier, ObjectPool.ObjectSanitizer<@NonNull O> sanitizer)

Method Detail

takeback to summary
public ObjectPool.Lease<O> take()

Implements org.newsclub.net.unix.pool.ObjectPool.take.

Doc from org.newsclub.net.unix.pool.ObjectPool.take.

Takes an exclusive lease of an object from the pool. If no existing object is available from the pool, a new one may be provided.

Returns:ObjectPool.Lease<O>

The object.

Annotations
@Override