com.facebook.common.references.ResourceReleaser<T> |
Known Indirect Subclasses |
Interface that abstracts the action of releasing a resource.
There are multiple components that own resources that are shared by others, like pools and caches. This interface should be implemented by classes that want to perform some action when a particular resource is no longer needed.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
abstract void |
release(T value)
Release the given value.
|
Release the given value.
After calling this method, the caller is no longer responsible for managing lifetime of the value.
This method is not permitted to throw an exception and is always required to succeed. It is often called from contexts like catch blocks or finally blocks to cleanup resources. Throwing an exception could result in swallowing the original exception.