All Methods Instance Methods Abstract Methods Modifier and Type Method Description
getLinkedResource(java.lang.Class<T> typeClass)Gets the linked resource (if set) and returns it using the type information provided to cast the returned value.
getTxnId()Returns the transaction Id that is associated with the declared transaction.
setLinkedResource(java.lang.Object resource)Links a given resource to this
Transaction.DischargeState getDischargeState()For a
Transactionthat has either been requested to discharge or has successfully discharged the
Transaction.DischargeStatereflects whether the transaction was to be committed or rolled back. Prior to a discharge being attempted there is no state value and this method returns a
- the current
Transaction.DischargeStateof the transaction.
boolean isFailed()The parent resource will mark the
Transactionas failed is any of the operations performed on it cannot be successfully completed such as a
Declareoperation failing to write due to an IO error.
- true if the
Transactionhas been marked failed by the parent resource.
ErrorCondition getCondition()If the declare or discharge of the transaction caused its state to become
TransactionStateFAILED this method returns the
ErrorConditionthat the remote used to describe the reason for the failure.
E parent()Returns a reference to the parent of this
Transactionwhich will be either a
TransactionManagermanager depending on the end of the
Linkthat is operating on the
- a reference to the parent of this
Binary getTxnId()Returns the transaction Id that is associated with the declared transaction. Prior to a
TransactionManagercompleting a transaction declaration this method will return null to indicate that the transaction has not been declared yet.
- the transaction Id associated with the transaction once successfully declared.
void setLinkedResource(java.lang.Object resource)Links a given resource to this
resource- The resource to link to this
- the user set linked resource for this
<T> T getLinkedResource(java.lang.Class<T> typeClass)
- Type Parameters:
T- The type to cast the linked resource to if one is set.
typeClass- the type's Class which is used for casting the returned value.
- the user set linked resource for this Context instance.
java.lang.ClassCastException- if the linked resource cannot be cast to the type requested.