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, notifyClosing
static 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()
Closeable
close
in interface AutoCloseable
close
in interface Closeable
long refCount()
default boolean tryReserve()
Copyright © 2015. All rights reserved.