Class LocalTxInvocationContext

All Implemented Interfaces:
Cloneable, EntryLookup, TxInvocationContext<LocalTransaction>, InvocationContext

public class LocalTxInvocationContext extends AbstractTxInvocationContext<LocalTransaction>
Invocation context to be used for locally originated transactions.
Since:
4.0
Author:
Mircea.Markus@jboss.com, Galder ZamarreƱo, Pedro Ruivo
  • Constructor Details

    • LocalTxInvocationContext

      public LocalTxInvocationContext(LocalTransaction localTransaction)
  • Method Details

    • isTransactionValid

      public final boolean isTransactionValid()
      Returns:
      true if the current transaction is in a valid state to perform operations on (i.e.,RUNNING or PREPARING) or false otherwise.
    • isImplicitTransaction

      public final boolean isImplicitTransaction()
    • isOriginLocal

      public final boolean isOriginLocal()
      Description copied from interface: InvocationContext
      Returns true if the call was originated locally, false if it is the result of a remote rpc.
      Specified by:
      isOriginLocal in interface InvocationContext
      Overrides:
      isOriginLocal in class AbstractInvocationContext
    • hasLockedKey

      public final boolean hasLockedKey(Object key)
      Description copied from interface: InvocationContext
      Returns true if the lock being tested is already held in the current scope, false otherwise.
      Specified by:
      hasLockedKey in interface InvocationContext
      Overrides:
      hasLockedKey in class AbstractInvocationContext
      Parameters:
      key - lock to test
    • remoteLocksAcquired

      public final void remoteLocksAcquired(Collection<Address> nodes)
    • getRemoteLocksAcquired

      public final Collection<Address> getRemoteLocksAcquired()
    • getTransaction

      public final jakarta.transaction.Transaction getTransaction()
      Description copied from interface: TxInvocationContext
      Returns the tx associated with the current thread. This method MUST be guarded with a call to InvocationContext.isOriginLocal(), as
      invalid reference
      javax.transaction.Transaction
      are not propagated from the node where tx was started.
    • hasIracMetadata

      public boolean hasIracMetadata(Object key)
      Returns:
      true if there is an IracMetadata stored for key.
    • storeIracMetadata

      public void storeIracMetadata(Object key, CompletionStage<IracMetadata> metadata)
      Stores the IracMetadata associated with key.
      Parameters:
      key - The key.
      metadata - The CompletionStage that will be completed with IracMetadata to associate.
    • getIracMetadata

      public CompletionStage<IracMetadata> getIracMetadata(Object key)
      Returns:
      The IracMetadata associated with key.