T
- resource typepublic class PooledResource<T> extends CloseableResource<T>
Pool
, and will be released back
to the pool when it's closed. If the resource is leaked from the pool, the resource will
be closed if it's closeable.Modifier and Type | Field and Description |
---|---|
protected WeakReference<Pool<T>> |
mPool |
protected String |
mPoolDescription |
Constructor and Description |
---|
PooledResource(T resource,
Pool<T> pool)
Creates a new pooled resource with the pool from which it was acquired.
|
Modifier and Type | Method and Description |
---|---|
void |
closeResource()
Performs any cleanup operations necessary when the resource is no longer in use.
|
close, get, isClosed
protected final WeakReference<Pool<T>> mPool
protected final String mPoolDescription
public void closeResource()
CloseableResource
closeResource
in class CloseableResource<T>
Copyright © 2023. All Rights Reserved.