public interface ReferenceCounted extends Closeable
| Modifier and Type | Method and Description |
|---|---|
default void |
close()
Doesn't throw a checked exception.
|
long |
refCount() |
void |
release()
release a resource
|
static void |
release(Object o)
release a reference counted object
|
static void |
releaseAll(List<WeakReference<ReferenceCounted>> refCounts) |
void |
reserve()
reserve a resource
|
default boolean |
tryReserve() |
closeQuietly, notifyClosingstatic void releaseAll(List<WeakReference<ReferenceCounted>> refCounts)
static void release(Object o)
o - to release if ReferenceCountedvoid reserve()
throws IllegalStateException
IllegalStateException - if the resource has already been freed.void release()
throws IllegalStateException
IllegalStateException - if the resource has already been freed.default void close()
Closeableclose in interface AutoCloseableclose in interface Closeablelong refCount()
default boolean tryReserve()
Copyright © 2016. All rights reserved.