Package org.aksw.commons.util.ref
Class ResourceHolderImpl<T>
java.lang.Object
org.aksw.commons.util.ref.ResourceHolderImpl<T>
- Type Parameters:
T-
- All Implemented Interfaces:
AutoCloseable,ResourceHolder<T>
Associate a resource with a closing mechanism
- Author:
- raven
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
value
-
closeActionRun
protected boolean closeActionRun -
closeAction
-
-
Constructor Details
-
ResourceHolderImpl
-
-
Method Details
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
isValid
public boolean isValid()Description copied from interface:ResourceHolderA resource holder is valid as long as it was not closed. Note, that the underlying resource may yet be closed.- Specified by:
isValidin interfaceResourceHolder<T>- Returns:
-
get
- Specified by:
getin interfaceResourceHolder<T>
-