use of com.hazelcast.transaction.TransactionContext in project hazelcast by hazelcast.
the class TransactionalMapIsEmptyMessageTask method innerCall.
@Override
protected Object innerCall() throws Exception {
final TransactionContext context = getEndpoint().getTransactionContext(parameters.txnId);
final TransactionalMap map = context.getMap(parameters.name);
return map.isEmpty();
}
use of com.hazelcast.transaction.TransactionContext in project hazelcast by hazelcast.
the class TransactionalMapPutMessageTask method innerCall.
@Override
protected Object innerCall() throws Exception {
final TransactionContext context = getEndpoint().getTransactionContext(parameters.txnId);
final TransactionalMap map = context.getMap(parameters.name);
Object response = map.put(parameters.key, parameters.value, parameters.ttl, TimeUnit.MILLISECONDS);
return serializationService.toData(response);
}
use of com.hazelcast.transaction.TransactionContext in project hazelcast by hazelcast.
the class TransactionalMapRemoveMessageTask method innerCall.
@Override
protected Object innerCall() throws Exception {
final TransactionContext context = getEndpoint().getTransactionContext(parameters.txnId);
final TransactionalMap map = context.getMap(parameters.name);
Object oldValue = map.remove(parameters.key);
return serializationService.toData(oldValue);
}
use of com.hazelcast.transaction.TransactionContext in project hazelcast by hazelcast.
the class TransactionalQueueOfferMessageTask method innerCall.
@Override
protected Object innerCall() throws Exception {
final TransactionContext context = endpoint.getTransactionContext(parameters.txnId);
final TransactionalQueue queue = context.getQueue(parameters.name);
return queue.offer(parameters.item, parameters.timeout, TimeUnit.MILLISECONDS);
}
use of com.hazelcast.transaction.TransactionContext in project hazelcast by hazelcast.
the class TransactionalQueuePeekMessageTask method innerCall.
@Override
protected Object innerCall() throws Exception {
final TransactionContext context = endpoint.getTransactionContext(parameters.txnId);
final TransactionalQueue queue = context.getQueue(parameters.name);
Object item = queue.peek(parameters.timeout, TimeUnit.MILLISECONDS);
return serializationService.toData(item);
}
Aggregations