Module com.github.robtimus.pool
Package com.github.robtimus.pool
Interface PoolableObject.Reference<X extends Exception>
- 
- Type Parameters:
 X- The type of exception that can be thrown when resources are released.
- All Superinterfaces:
 AutoCloseable
- Enclosing class:
 - PoolableObject<X extends Exception>
 
public static interface PoolableObject.Reference<X extends Exception> extends AutoCloseable
A reference to aPoolableObject. If a reference is removed or closed and no more references to thePoolableObjectfrom which it was created remain, thePoolableObjectwill be returned to the pool it was acquired from. If it is not associated with a pool, its resources will bereleasedinstead.- Author:
 - Rob Spoor
 - Since:
 - 2.0
 
 
- 
- 
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidclose()Removes the reference to thePoolableObjectfrom which this reference was created.voidremove()Removes the reference to thePoolableObjectfrom which this reference was created. 
 - 
 
- 
- 
Method Detail
- 
remove
void remove() throws X extends ExceptionRemoves the reference to thePoolableObjectfrom which this reference was created. If no more references remain, thePoolableObjectwill be returned to the pool it was acquired from. If it is not associated with a pool, its resources will bereleasedcalled instead. 
- 
close
default void close() throws X extends ExceptionRemoves the reference to thePoolableObjectfrom which this reference was created. This method is an alias forremove()that allows instances to be used in try-with-resources blocks.- Specified by:
 closein interfaceAutoCloseable- Throws:
 X- If the resources could not be released.X extends Exception
 
 - 
 
 -