public abstract class ReferenceCountedResource extends Object implements AutoCloseable
| Constructor and Description |
|---|
ReferenceCountedResource() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Useful when used together with try-with-resources pattern
|
boolean |
release()
Decreases the reference count by 1 and calls
this#destroy if the reference count reaches 0. |
ReferenceCountedResource |
retain()
Increments the reference count by 1.
|
public final ReferenceCountedResource retain()
public final boolean release()
this#destroy if the reference count reaches 0.public final void close()
close in interface AutoCloseableCopyright © 2011–2020 The Apache Software Foundation. All rights reserved.