use of com.hazelcast.client.impl.protocol.ClientMessage in project hazelcast by hazelcast.
the class XAResourceProxy method clearRemoteTransactions.
private void clearRemoteTransactions(Xid xid) {
SerializableXID serializableXID = new SerializableXID(xid.getFormatId(), xid.getGlobalTransactionId(), xid.getBranchQualifier());
SerializationService serializationService = getContext().getSerializationService();
Data xidData = serializationService.toData(serializableXID);
ClientMessage request = XATransactionClearRemoteCodec.encodeRequest(serializableXID);
invoke(request, xidData);
}
use of com.hazelcast.client.impl.protocol.ClientMessage in project hazelcast by hazelcast.
the class XATransactionProxy method begin.
void begin() {
try {
startTime = Clock.currentTimeMillis();
ClientMessage request = XATransactionCreateCodec.encodeRequest(xid, timeout);
ClientMessage response = invoke(request);
txnId = XATransactionCreateCodec.decodeResponse(response).response;
state = ACTIVE;
} catch (Exception e) {
throw ExceptionUtil.rethrow(e);
}
}
use of com.hazelcast.client.impl.protocol.ClientMessage in project hazelcast by hazelcast.
the class ClientTxnQueueProxy method offer.
@Override
public boolean offer(E e, long timeout, TimeUnit unit) throws InterruptedException {
Data data = toData(e);
ClientMessage request = TransactionalQueueOfferCodec.encodeRequest(name, getTransactionId(), getThreadId(), data, unit.toMillis(timeout));
ClientMessage response = invoke(request);
return TransactionalQueueOfferCodec.decodeResponse(response).response;
}
use of com.hazelcast.client.impl.protocol.ClientMessage in project hazelcast by hazelcast.
the class ClientTxnQueueProxy method poll.
@Override
public E poll(long timeout, TimeUnit unit) throws InterruptedException {
ClientMessage request = TransactionalQueuePollCodec.encodeRequest(name, getTransactionId(), getThreadId(), unit.toMillis(timeout));
ClientMessage response = invoke(request);
return (E) toObject(TransactionalQueuePollCodec.decodeResponse(response).response);
}
use of com.hazelcast.client.impl.protocol.ClientMessage in project hazelcast by hazelcast.
the class ClientTxnSetProxy method size.
@Override
public int size() {
ClientMessage request = TransactionalSetSizeCodec.encodeRequest(name, getTransactionId(), getThreadId());
ClientMessage response = invoke(request);
return TransactionalSetSizeCodec.decodeResponse(response).response;
}
Aggregations