Search in sources :

Example 6 with AsyncAtomicLong

use of com.hazelcast.core.AsyncAtomicLong in project wso2-synapse by wso2.

the class HazelcastDistributedCounterManager method asyncGetAndAddCounter.

@Override
public long asyncGetAndAddCounter(String key, long value) {
    HazelcastInstance hazelcastInstance = getHazelcastInstance();
    AsyncAtomicLong asyncAtomicLong = (AsyncAtomicLong) hazelcastInstance.getAtomicLong(key);
    long currentGlobalCounter = asyncAtomicLong.get();
    asyncAtomicLong.asyncAddAndGet(value);
    return currentGlobalCounter;
}
Also used : AsyncAtomicLong(com.hazelcast.core.AsyncAtomicLong) HazelcastInstance(com.hazelcast.core.HazelcastInstance)

Aggregations

AsyncAtomicLong (com.hazelcast.core.AsyncAtomicLong)6 HazelcastInstance (com.hazelcast.core.HazelcastInstance)4 IAtomicLong (com.hazelcast.core.IAtomicLong)2 TimeStep (com.hazelcast.simulator.test.annotations.TimeStep)2