java.lang.Object
stormpot.BasePoolable
stormpot.Pooled<T>
- Type Parameters:
T- The type of object referenced by thePooled.
- All Implemented Interfaces:
AutoCloseable,Poolable
A reference to a pooled object.
-
Field Summary
FieldsFields inherited from class stormpot.BasePoolable
slot -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class stormpot.BasePoolable
expire, release
-
Field Details
-
object
Deprecated.UsegetObject()instead.The object managed by this pooled instance.
-
-
Constructor Details
-
Pooled
Create a pooled object for the given slot and object to be pooled.- Parameters:
slot- The slot an object is being allocated for.object- The object this pooled instance represents.
-
-
Method Details
-
getObject
Get the pooled object.- Returns:
- The pooled object held by this
Pooledreference.
-
close
public void close()PooledimplementsAutoCloseableas a convenient way to release claimed objects back to the pool, using the try-with-resources syntax.- Specified by:
closein interfaceAutoCloseable
-
toString
-
getObject()instead.