Package org.jgroups.blocks.atomic
Interface Counter
-
- All Superinterfaces:
BaseCounter
,SyncCounter
@Deprecated public interface Counter extends SyncCounter
Deprecated.Since 5.2 and to be removed in a future version. UseSyncCounter
instead.- Since:
- 3.0.0
- Author:
- Bela Ban
-
-
Method Summary
All Methods Instance Methods Default Methods Deprecated Methods Modifier and Type Method Description default AsyncCounter
async()
Deprecated.Returns anAsyncCounter
wrapper for this instance.default long
compareAndSwap(long expect, long update)
Deprecated.Atomically updates the counter using a compare-and-swap operation.-
Methods inherited from interface org.jgroups.blocks.atomic.BaseCounter
getName
-
Methods inherited from interface org.jgroups.blocks.atomic.SyncCounter
addAndGet, compareAndSet, decrementAndGet, get, incrementAndGet, set, sync, update
-
-
-
-
Method Detail
-
compareAndSwap
default long compareAndSwap(long expect, long update)
Deprecated.Description copied from interface:SyncCounter
Atomically updates the counter using a compare-and-swap operation.- Specified by:
compareAndSwap
in interfaceSyncCounter
- Parameters:
expect
- The expected value of the counterupdate
- The new value of the counter- Returns:
- The previous value of the counter
-
async
default AsyncCounter async()
Deprecated.Description copied from interface:BaseCounter
Returns anAsyncCounter
wrapper for this instance. If this counter is already asynchronous, then this counter instance is returned (no-op)- Specified by:
async
in interfaceBaseCounter
- Returns:
- The
AsyncCounter
instance.
-
-