Constructor and Description |
---|
ClusteredCounterImpl(Vertx vertx,
org.jgroups.blocks.atomic.Counter counter) |
Modifier and Type | Method and Description |
---|---|
void |
addAndGet(long delta,
Handler<AsyncResult<Long>> handler)
Add the value to the counter atomically and return the new count
|
void |
compareAndSet(long expected,
long update,
Handler<AsyncResult<Boolean>> handler)
Set the counter to the specified value only if the current value is the expectec value.
|
void |
decrementAndGet(Handler<AsyncResult<Long>> handler)
Decrement the counter atomically and return the new count
|
void |
get(Handler<AsyncResult<Long>> handler)
Get the current value of the counter
|
void |
getAndAdd(long delta,
Handler<AsyncResult<Long>> handler)
Add the value to the counter atomically and return the value before the add
|
void |
getAndIncrement(Handler<AsyncResult<Long>> handler)
Increment the counter atomically and return the value before the increment.
|
void |
incrementAndGet(Handler<AsyncResult<Long>> handler)
Increment the counter atomically and return the new count
|
public ClusteredCounterImpl(Vertx vertx, org.jgroups.blocks.atomic.Counter counter)
public void get(Handler<AsyncResult<Long>> handler)
Counter
public void incrementAndGet(Handler<AsyncResult<Long>> handler)
Counter
incrementAndGet
in interface Counter
handler
- handler which will be passed the valuepublic void getAndIncrement(Handler<AsyncResult<Long>> handler)
Counter
getAndIncrement
in interface Counter
handler
- handler which will be passed the valuepublic void decrementAndGet(Handler<AsyncResult<Long>> handler)
Counter
decrementAndGet
in interface Counter
handler
- handler which will be passed the valuepublic void addAndGet(long delta, Handler<AsyncResult<Long>> handler)
Counter
public void getAndAdd(long delta, Handler<AsyncResult<Long>> handler)
Counter
public void compareAndSet(long expected, long update, Handler<AsyncResult<Boolean>> handler)
Counter
compareAndSet
in interface Counter
expected
- the expected valueupdate
- the new valuehandler
- the handler will be passed true on successCopyright © 2015. All rights reserved.