@ThreadSafe @ParametersAreNonnullByDefault public interface SmartRecyclingSupplier<T> extends BlockingDisposable, Scanable<T>
Scanable.ScanHandler<O>
Modifier and Type | Method and Description |
---|---|
default T |
get(ObjectBorower borower)
Borrow object from pool.
|
default T |
get(ObjectBorower borower,
long timeout,
TimeUnit unit) |
T |
getSample() |
void |
recycle(T object,
ObjectBorower borower)
Return object to pool.
|
T |
tryGet(ObjectBorower borower,
long deadlineNanos) |
default T |
tryGet(ObjectBorower borower,
long timeout,
TimeUnit unit) |
close, dispose, dispose, tryDispose
@Nonnull default T get(ObjectBorower borower) throws InterruptedException, TimeoutException, ObjectCreationException
borower
- InterruptedException
TimeoutException
ObjectCreationException
@Nonnull default T get(ObjectBorower borower, long timeout, TimeUnit unit) throws ObjectCreationException, InterruptedException, TimeoutException
@Nullable default T tryGet(ObjectBorower borower, long timeout, TimeUnit unit) throws ObjectCreationException, InterruptedException
@Nullable T tryGet(ObjectBorower borower, long deadlineNanos) throws ObjectCreationException, InterruptedException
void recycle(T object, ObjectBorower borower)
object
- borower
- Copyright © 2018 SPF4J. All rights reserved.