public class TccClient
extends java.lang.Object
Constructor and Description |
---|
TccClient() |
Modifier and Type | Method and Description |
---|---|
static void |
addTccParticipant(java.lang.String uri)
Add a participant to the current TCC transaction
|
static CancelResponse |
cancel()
Cancel the TCC transaction
|
static CancelResponse |
cancel(java.util.List<TccParticipant> participants)
Cancel the TCC transaction optionally adding additional participants
|
static ConfirmResponse |
confirm()
Confirm the TCC transaction
|
static ConfirmResponse |
confirm(java.util.List<TccParticipant> participants)
Confirm the TCC transaction optionally adding additional participants
|
static long |
getTimeLimit()
Get the time limit in milliseconds for the current TCC transaction This value overrides the value set via @TCC annotation
|
static java.lang.String |
getTransactionId()
Get the current transaction id
|
static void |
setTimeLimit(long timeLimit)
Set the time limit in milliseconds for the current transaction.
|
public static ConfirmResponse confirm() throws TccUnknownTransactionException, TccHeuristicException, TccException
This asks the transaction coordinator to confirm all the participants in the transaction.
TccException
- some failure occurred communicating with the transaction coordinatorTccUnknownTransactionException
- transaction not found or unknown error at coordinator sideTccHeuristicException
- not all the participants confirmedpublic static ConfirmResponse confirm(java.util.List<TccParticipant> participants) throws TccUnknownTransactionException, TccHeuristicException, TccException
This asks the transaction coordinator to confirm all the participants in the transaction including those added by this call.
participants
- list of TccParticipants to be included in the confirmation of the transactionTccException
- some failure occurred communicating with the transaction coordinatorTccUnknownTransactionException
- transaction not found or unknown error at coordinator sideTccHeuristicException
- not all the participants confirmedpublic static CancelResponse cancel() throws TccUnknownTransactionException, TccHeuristicException, TccException
This asks the transaction coordinator to cancel all the participants.
TccException
- some failure occurred communicating with the transaction coordinatorTccUnknownTransactionException
- transaction not found or unknown error at coordinator sideTccHeuristicException
- not all the participants cancelledpublic static CancelResponse cancel(java.util.List<TccParticipant> participants) throws TccUnknownTransactionException, TccHeuristicException, TccException
This asks the transaction coordinator to cancel all the participants in the transaction including those added by this call.
participants
- optional list of TccParticipants to be included in the cancelling of the transactionTccException
- some failure occurred communicating with the transaction coordinatorTccUnknownTransactionException
- transaction not found or unknown error at coordinator sideTccHeuristicException
- not all the participants cancelledpublic static java.lang.String getTransactionId() throws TccUnknownTransactionException
TccUnknownTransactionException
- TCC transaction is associated to the current threadpublic static void addTccParticipant(java.lang.String uri) throws TccUnknownTransactionException
uri
- the URI of the participant resourceTccUnknownTransactionException
- TCC transaction is associated to the current threadpublic static void setTimeLimit(long timeLimit) throws TccUnknownTransactionException
timeLimit
- time limit in millisecondsTccUnknownTransactionException
- TCC transaction is associated to the current threadpublic static long getTimeLimit() throws TccUnknownTransactionException
TccUnknownTransactionException
- TCC transaction is associated to the current threadCopyright © 2022, Oracle and/or its affiliates.