Package alluxio.resource
Class PooledResource<T>
- java.lang.Object
-
- alluxio.resource.CloseableResource<T>
-
- alluxio.resource.PooledResource<T>
-
- Type Parameters:
T
- resource type
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class PooledResource<T> extends CloseableResource<T>
A pooled resource that was acquired from aPool
, 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.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.ref.WeakReference<Pool<T>>
mPool
protected java.lang.String
mPoolDescription
-
Constructor Summary
Constructors Constructor Description PooledResource(T resource, Pool<T> pool)
Creates a new pooled resource with the pool from which it was acquired.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
closeResource()
Performs any cleanup operations necessary when the resource is no longer in use.-
Methods inherited from class alluxio.resource.CloseableResource
close, get
-
-
-
-
Method Detail
-
closeResource
public void closeResource()
Description copied from class:CloseableResource
Performs any cleanup operations necessary when the resource is no longer in use.- Specified by:
closeResource
in classCloseableResource<T>
-
-