Interface Transaction<E extends Endpoint<?>>

    • Method Detail

      • isFailed

        boolean isFailed()
        The parent resource will mark the Transaction as failed is any of the operations performed on it cannot be successfully completed such as a Declare operation failing to write due to an IO error.
        Returns:
        true if the Transaction has been marked failed by the parent resource.
      • getTxnId

        Binary getTxnId()
        Returns the transaction Id that is associated with the declared transaction. Prior to a TransactionManager completing a transaction declaration this method will return null to indicate that the transaction has not been declared yet.
        Returns:
        the transaction Id associated with the transaction once successfully declared.
      • setLinkedResource

        void setLinkedResource​(Object resource)
        Links a given resource to this Transaction.
        Parameters:
        resource - The resource to link to this Transaction.
      • getLinkedResource

        Object getLinkedResource()
        Returns:
        the user set linked resource for this Transaction instance.
      • getLinkedResource

        <T> T getLinkedResource​(Class<T> typeClass)
        Gets the linked resource (if set) and returns it using the type information provided to cast the returned value.
        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.
        Throws:
        ClassCastException - if the linked resource cannot be cast to the type requested.