Package org.jgroups.util
Class RefcountImpl<T>
- java.lang.Object
-
- org.jgroups.util.RefcountImpl<T>
-
public class RefcountImpl<T> extends java.lang.ObjectRef-counted implementation; can be used by message implementations.
Note that this class is experimental and may get removed without notice. The point of it is to get experience with ref counted messages and see if they're needed or not.
See https://issues.redhat.com/browse/JGRP-2417 for details- Since:
- 5.1.0
-
-
Field Summary
Fields Modifier and Type Field Description protected byterefcountprotected java.util.function.Consumer<T>release_code
-
Constructor Summary
Constructors Constructor Description RefcountImpl()RefcountImpl(java.util.function.Consumer<T> c)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RefcountImpl<T>decr(T t)bytegetRefcount()RefcountImpl<T>incr()RefcountImpl<T>onRelease(java.util.function.Consumer<T> rc)protected voidrelease(T t)java.lang.StringtoString()
-
-
-
Field Detail
-
refcount
protected byte refcount
-
release_code
protected java.util.function.Consumer<T> release_code
-
-
Constructor Detail
-
RefcountImpl
public RefcountImpl()
-
RefcountImpl
public RefcountImpl(java.util.function.Consumer<T> c)
-
-
Method Detail
-
getRefcount
public byte getRefcount()
-
incr
public RefcountImpl<T> incr()
-
decr
public RefcountImpl<T> decr(T t)
-
onRelease
public RefcountImpl<T> onRelease(java.util.function.Consumer<T> rc)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
release
protected void release(T t)
-
-