Package io.grpc.xds.client
Class ReferenceCounted<T>
java.lang.Object
io.grpc.xds.client.ReferenceCounted<T>
A reference count wrapper for objects. This class does not take the ownership for the object,
but only provides usage counting. The real owner of the wrapped object is responsible for
managing the lifecycle of the object.
Intended for a container class to keep track of lifecycle for elements it contains. This wrapper itself should never be returned to the consumers of the elements to avoid reference counts being leaked.
-
Field Details
-
instance
-
refs
private int refs
-
-
Constructor Details
-
ReferenceCounted
-
-
Method Details
-
wrap
-
retain
void retain() -
release
void release() -
getReferenceCount
int getReferenceCount() -
get
T get()
-