public TransactionalState newInstance(Object described) { List l = (List) described; TransactionalState o = new TransactionalState(); if(l.isEmpty()) { throw new DecodeException("The txn-id field cannot be omitted"); } switch(2 - l.size()) { case 0: o.setOutcome( (Outcome) l.get( 1 ) ); case 1: o.setTxnId( (Binary) l.get( 0 ) ); } return o; }
public TransactionalState newInstance(Object described) { List l = (List) described; TransactionalState o = new TransactionalState(); if(l.isEmpty()) { throw new DecodeException("The txn-id field cannot be omitted"); } switch(2 - l.size()) { case 0: o.setOutcome( (Outcome) l.get( 1 ) ); case 1: o.setTxnId( (Binary) l.get( 0 ) ); } return o; }
public TransactionalState newInstance(Object described) { List l = (List) described; TransactionalState o = new TransactionalState(); if(l.isEmpty()) { throw new DecodeException("The txn-id field cannot be omitted"); } switch(2 - l.size()) { case 0: o.setOutcome( (Outcome) l.get( 1 ) ); case 1: o.setTxnId( (Binary) l.get( 0 ) ); } return o; }
public TransactionalState newInstance(Object described) { List l = (List) described; TransactionalState o = new TransactionalState(); if(l.isEmpty()) { throw new DecodeException("The txn-id field cannot be omitted"); } switch(2 - l.size()) { case 0: o.setOutcome( (Outcome) l.get( 1 ) ); case 1: o.setTxnId( (Binary) l.get( 0 ) ); } return o; }
@Override public void onSuccess() { current = txId; cachedAcceptedState = new TransactionalState(); cachedAcceptedState.setOutcome(Accepted.getInstance()); cachedAcceptedState.setTxnId(getAmqpTransactionId()); cachedTransactedState = new TransactionalState(); cachedTransactedState.setTxnId(getAmqpTransactionId()); request.onSuccess(); }
@Override public void onSuccess() { current = txId; cachedAcceptedState = new TransactionalState(); cachedAcceptedState.setOutcome(Accepted.getInstance()); cachedAcceptedState.setTxnId(getAmqpTransactionId()); cachedTransactedState = new TransactionalState(); cachedTransactedState.setTxnId(getAmqpTransactionId()); request.onSuccess(); }
if (transaction != TransactionContext.NULL_TXN) { state = new TransactionalState(); ((TransactionalState)state).setTxnId(new Binary(transaction.getTransactionId().array())); ((TransactionalState)state).setOutcome(outcome); } else {
if (transaction != TransactionContext.NULL_TXN) { TransactionalState transactionalState = new TransactionalState(); transactionalState.setTxnId(new Binary(transaction.getTransactionId().array())); delivery.disposition(transactionalState);
TransactionalState txAccepted = new TransactionalState(); txAccepted.setOutcome(Accepted.getInstance()); txAccepted.setTxnId(txState.getTxnId()); delivery.disposition(txAccepted);
TransactionalState txAccepted = new TransactionalState(); txAccepted.setOutcome(Accepted.getInstance()); txAccepted.setTxnId(txState.getTxnId());
TransactionalState txAccepted = new TransactionalState(); txAccepted.setOutcome(Accepted.getInstance()); txAccepted.setTxnId(txState.getTxnId()); delivery.disposition(txAccepted);
if (transaction != TransactionContext.NULL_TXN) { TransactionalState transactionalState = new TransactionalState(); transactionalState.setTxnId(new Binary(transaction.getTransactionId().array())); delivery.disposition(transactionalState);
private void doSend(AmqpMessage message, AsyncResult request, AmqpTransactionId txId) throws Exception { LOG.trace("Producer sending message: {}", message); Delivery delivery = null; if (presettle) { delivery = getEndpoint().delivery(EMPTY_BYTE_ARRAY, 0, 0); } else { byte[] tag = tagGenerator.getNextTag(); delivery = getEndpoint().delivery(tag, 0, tag.length); } delivery.setContext(request); Binary amqpTxId = null; if (txId != null) { amqpTxId = txId.getRemoteTxId(); } else if (session.isInTransaction()) { amqpTxId = session.getTransactionId().getRemoteTxId(); } if (amqpTxId != null) { TransactionalState state = new TransactionalState(); state.setTxnId(amqpTxId); delivery.disposition(state); } encodeAndSend(message.getWrappedMessage(), delivery); if (presettle) { delivery.settle(); request.onSuccess(); } else { pending.add(delivery); getEndpoint().advance(); } }
TransactionalState txAccepted = new TransactionalState(); txAccepted.setOutcome(Accepted.getInstance()); txAccepted.setTxnId(txState.getTxnId());
TransactionalState txAccepted = new TransactionalState(); txAccepted.setOutcome(Accepted.getInstance()); txAccepted.setTxnId(txState.getTxnId());
@Override public void done() { connection.runLater(() -> { if (delivery.getRemoteState() instanceof TransactionalState) { TransactionalState txAccepted = new TransactionalState(); txAccepted.setOutcome(Accepted.getInstance()); txAccepted.setTxnId(((TransactionalState) delivery.getRemoteState()).getTxnId()); delivery.disposition(txAccepted); } else { delivery.disposition(Accepted.getInstance()); } delivery.settle(); context.flow(); connection.flush(); }); }
@Override public void done() { connection.lock(); try { if (delivery.getRemoteState() instanceof TransactionalState) { TransactionalState txAccepted = new TransactionalState(); txAccepted.setOutcome(Accepted.getInstance()); txAccepted.setTxnId(((TransactionalState) delivery.getRemoteState()).getTxnId()); delivery.disposition(txAccepted); } else { delivery.disposition(Accepted.getInstance()); } delivery.settle(); } finally { connection.unlock(); } connection.flush(); }
@Override public void run() { checkClosed(); try { if (!delivery.isSettled()) { if (session.isInTransaction()) { Binary txnId = session.getTransactionId().getRemoteTxId(); if (txnId != null) { TransactionalState txState = new TransactionalState(); txState.setOutcome(Accepted.getInstance()); txState.setTxnId(txnId); delivery.disposition(txState); session.getTransactionContext().registerTxConsumer(AmqpReceiver.this); } } else { delivery.disposition(Accepted.getInstance()); } if (settle) { delivery.settle(); } } session.pumpToProtonTransport(request); request.onSuccess(); } catch (Exception e) { request.onFailure(e); } } });
TransactionalState txAccepted = new TransactionalState(); txAccepted.setOutcome(Accepted.getInstance()); txAccepted.setTxnId(((TransactionalState) remoteState).getTxnId());
TransactionalState txAccepted = new TransactionalState(); txAccepted.setOutcome(Accepted.getInstance()); txAccepted.setTxnId(((TransactionalState) remoteState).getTxnId());