Class ProtonTransaction<E extends Endpoint<?>>
java.lang.Object
org.apache.qpid.protonj2.engine.impl.ProtonTransaction<E>
- Type Parameters:
- E- The parent type for this- Transaction
- All Implemented Interfaces:
- Transaction<E>
public abstract class ProtonTransaction<E extends Endpoint<?>>
extends Object
implements Transaction<E>
Base 
Transaction implementation that provides the basic functionality needed
 to manage the Transaction that it represents.- 
Nested Class SummaryNested classes/interfaces inherited from interface org.apache.qpid.protonj2.engine.TransactionTransaction.DischargeState
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionIf the declare or discharge of the transaction caused its state to becomeTransactionStateFAILED this method returns theErrorConditionthat the remote used to describe the reason for the failure.For aTransactionthat has either been requested to discharge or has successfully discharged theTransaction.DischargeStatereflects whether the transaction was to be committed or rolled back.<T> TgetLinkedResource(Class<T> typeClass) Gets the linked resource (if set) and returns it using the type information provided to cast the returned value.getState()getTxnId()Returns the transaction Id that is associated with the declared transaction.booleanbooleanbooleanisFailed()The parent resource will mark theTransactionas failed is any of the operations performed on it cannot be successfully completed such as aDeclareoperation failing to write due to an IO error.abstract Eparent()Overridden by theTransactionControllerorTransactionManagerthat creates thisTransactioninstance, this method returns the parent instance that created it.voidsetLinkedResource(Object resource) Links a given resource to thisTransaction.
- 
Constructor Details- 
ProtonTransactionpublic ProtonTransaction()
 
- 
- 
Method Details- 
getState- Specified by:
- getStatein interface- Transaction<E extends Endpoint<?>>
- Returns:
- the current Transactionstate.
 
- 
isDeclaredpublic boolean isDeclared()- Specified by:
- isDeclaredin interface- Transaction<E extends Endpoint<?>>
- Returns:
- true if the Transactionhas been marked declared by theTransactionManager.
 
- 
isDischargedpublic boolean isDischarged()- Specified by:
- isDischargedin interface- Transaction<E extends Endpoint<?>>
- Returns:
- true if the Transactionhas been marked discharged by theTransactionManager.
 
- 
isFailedpublic boolean isFailed()Description copied from interface:TransactionThe parent resource will mark theTransactionas failed is any of the operations performed on it cannot be successfully completed such as aDeclareoperation failing to write due to an IO error.- Specified by:
- isFailedin interface- Transaction<E extends Endpoint<?>>
- Returns:
- true if the Transactionhas been marked failed by the parent resource.
 
- 
getConditionDescription copied from interface:TransactionIf the declare or discharge of the transaction caused its state to becomeTransactionStateFAILED this method returns theErrorConditionthat the remote used to describe the reason for the failure.- Specified by:
- getConditionin interface- Transaction<E extends Endpoint<?>>
- Returns:
- the ErrorConditionthat theTransactionManagerused to fail theTransaction.
 
- 
getDischargeStateDescription copied from interface:TransactionFor aTransactionthat has either been requested to discharge or has successfully discharged theTransaction.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 aTransaction.DischargeStateof none.- Specified by:
- getDischargeStatein interface- Transaction<E extends Endpoint<?>>
- Returns:
- the current Transaction.DischargeStateof the transaction.
 
- 
getTxnIdDescription copied from interface:TransactionReturns the transaction Id that is associated with the declared transaction. Prior to aTransactionManagercompleting a transaction declaration this method will return null to indicate that the transaction has not been declared yet.- Specified by:
- getTxnIdin interface- Transaction<E extends Endpoint<?>>
- Returns:
- the transaction Id associated with the transaction once successfully declared.
 
- 
setLinkedResourceDescription copied from interface:TransactionLinks a given resource to thisTransaction.- Specified by:
- setLinkedResourcein interface- Transaction<E extends Endpoint<?>>
- Parameters:
- resource- The resource to link to this- Transaction.
 
- 
getLinkedResource- Specified by:
- getLinkedResourcein interface- Transaction<E extends Endpoint<?>>
- Returns:
- the user set linked resource for this Transactioninstance.
 
- 
getLinkedResourceDescription copied from interface:TransactionGets the linked resource (if set) and returns it using the type information provided to cast the returned value.- Specified by:
- getLinkedResourcein interface- Transaction<E extends Endpoint<?>>
- Type Parameters:
- T- The type to cast the linked resource to if one is set.
- Parameters:
- typeClass- the type's Class which is used for casting the returned value.
- Returns:
- the user set linked resource for this Context instance.
 
- 
getAttachments- Specified by:
- getAttachmentsin interface- Transaction<E extends Endpoint<?>>
- Returns:
- the Attachmentsinstance that is associated with thisTransaction
 
- 
parentOverridden by theTransactionControllerorTransactionManagerthat creates thisTransactioninstance, this method returns the parent instance that created it.- Specified by:
- parentin interface- Transaction<E extends Endpoint<?>>
- Returns:
- the resource that created this Transaction.
 
 
-