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

pack-priv final Class ThreadLocalObjectPool<O>

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

Field Summary

Modifier and TypeField and Description
private final ObjectPool.Lease<O>
private final ObjectPool.ObjectSanitizer<O>
private final ThreadLocal<O>

Constructor Summary

AccessConstructor and Description
pack-priv

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

leaseImplback to summary
private final ObjectPool.Lease<O> leaseImpl
sanitizerback to summary
private final ObjectPool.ObjectSanitizer<O> sanitizer
tlback to summary
private final ThreadLocal<O> tl

Constructor Detail

ThreadLocalObjectPoolback to summary
pack-priv ThreadLocalObjectPool(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