T - The object type.public interface ReferenceCountedObject<T>
T get()
T retain()
release() method must be invoked afterward.
Otherwise, the object is not returned, and it will cause a resource leak.boolean release()
static <V> ReferenceCountedObject<V> wrap(V value, Runnable retainMethod, Runnable releaseMethod)
ReferenceCountedObject.Copyright © 2017–2023 The Apache Software Foundation. All rights reserved.