Class GammaOrElseBlock

java.lang.Object
org.multiverse.stms.gamma.GammaOrElseBlock
All Implemented Interfaces:
OrElseBlock, MultiverseConstants

public class GammaOrElseBlock extends Object implements OrElseBlock
  • Constructor Details

    • GammaOrElseBlock

      public GammaOrElseBlock()
  • Method Details

    • execute

      public <E> E execute(TxnCallable<E> either, TxnCallable<E> orelse)
      Description copied from interface: OrElseBlock
      Executes the either, or when it is retried, the orelse block. This operation makes composable blocking operations possible.

      If in the execution of the closure a checked exception is thrown, the exception is wrapped in a InvisibleCheckedException. The original exception can be retrieved by calling the getCause method.

      Specified by:
      execute in interface OrElseBlock
      Parameters:
      either -
      orelse -
      Returns:
      the result of the execution.
    • executeChecked

      public <E> E executeChecked(TxnCallable<E> either, TxnCallable<E> orelse) throws Exception
      Description copied from interface: OrElseBlock
      Executes the either, or when it is retried, the orelse block. This operation makes composable blocking operations possible.
      Specified by:
      executeChecked in interface OrElseBlock
      Parameters:
      either -
      orelse -
      Returns:
      the result of the execution.
      Throws:
      Exception - if the atomicChecked call fails.
    • execute

      public int execute(TxnIntCallable either, TxnIntCallable orelse)
      Description copied from interface: OrElseBlock
      Executes the either, or when it is retried, the orelse block. This operation makes composable blocking operations possible.

      If in the execution of the closure a checked exception is thrown, the exception is wrapped in a InvisibleCheckedException. The original exception can be retrieved by calling the getCause method.

      Specified by:
      execute in interface OrElseBlock
      Parameters:
      either -
      orelse -
      Returns:
      the result of the execution.
    • executeChecked

      public int executeChecked(TxnIntCallable either, TxnIntCallable orelse) throws Exception
      Description copied from interface: OrElseBlock
      Executes the either, or when it is retried, the orelse block. This operation makes composable blocking operations possible.
      Specified by:
      executeChecked in interface OrElseBlock
      Parameters:
      either -
      orelse -
      Returns:
      the result of the execution.
      Throws:
      Exception
    • execute

      public long execute(TxnLongCallable either, TxnLongCallable orelse)
      Description copied from interface: OrElseBlock
      Executes the either, or when it is retried, the orelse block. This operation makes composable blocking operations possible.

      If in the execution of the closure a checked exception is thrown, the exception is wrapped in a InvisibleCheckedException. The original exception can be retrieved by calling the getCause method.

      Specified by:
      execute in interface OrElseBlock
      Parameters:
      either -
      orelse -
      Returns:
      the result of the execution.
    • executeChecked

      public long executeChecked(TxnLongCallable either, TxnLongCallable orelse) throws Exception
      Description copied from interface: OrElseBlock
      Executes the either, or when it is retried, the orelse block. This operation makes composable blocking operations possible.
      Specified by:
      executeChecked in interface OrElseBlock
      Parameters:
      either -
      orelse -
      Returns:
      the result of the execution.
      Throws:
      Exception
    • execute

      public double execute(TxnDoubleCallable either, TxnDoubleCallable orelse)
      Description copied from interface: OrElseBlock
      Executes the either, or when it is retried, the orelse block. This operation makes composable blocking operations possible.

      If in the execution of the closure a checked exception is thrown, the exception is wrapped in a InvisibleCheckedException. The original exception can be retrieved by calling the getCause method.

      Specified by:
      execute in interface OrElseBlock
      Parameters:
      either -
      orelse -
      Returns:
      the result of the execution.
    • executeChecked

      public double executeChecked(TxnDoubleCallable either, TxnDoubleCallable orelse) throws Exception
      Description copied from interface: OrElseBlock
      Executes the either, or when it is retried, the orelse block. This operation makes composable blocking operations possible.
      Specified by:
      executeChecked in interface OrElseBlock
      Parameters:
      either -
      orelse -
      Returns:
      the result of the execution.
      Throws:
      Exception
    • execute

      public boolean execute(TxnBooleanCallable either, TxnBooleanCallable orelse)
      Description copied from interface: OrElseBlock
      Executes the either, or when it is retried, the orelse block. This operation makes composable blocking operations possible.

      If in the execution of the closure a checked exception is thrown, the exception is wrapped in a InvisibleCheckedException. The original exception can be retrieved by calling the getCause method.

      Specified by:
      execute in interface OrElseBlock
      Parameters:
      either -
      orelse -
      Returns:
      the result of the execution.
    • executeChecked

      public boolean executeChecked(TxnBooleanCallable either, TxnBooleanCallable orelse) throws Exception
      Description copied from interface: OrElseBlock
      Executes the either, or when it is retried, the orelse block. This operation makes composable blocking operations possible.
      Specified by:
      executeChecked in interface OrElseBlock
      Parameters:
      either -
      orelse -
      Returns:
      the result of the execution.
      Throws:
      Exception
    • execute

      public void execute(TxnVoidCallable either, TxnVoidCallable orelse)
      Description copied from interface: OrElseBlock
      Executes the either, or when it is retried, the orelse block. This operation makes composable blocking operations possible.

      If in the execution of the closure a checked exception is thrown, the exception is wrapped in a InvisibleCheckedException. The original exception can be retrieved by calling the getCause method.

      Specified by:
      execute in interface OrElseBlock
      Parameters:
      either -
      orelse -
    • executeChecked

      public void executeChecked(TxnVoidCallable either, TxnVoidCallable orelse) throws Exception
      Description copied from interface: OrElseBlock
      Executes the either, or when it is retried, the orelse block. This operation makes composable blocking operations possible.
      Specified by:
      executeChecked in interface OrElseBlock
      Parameters:
      either -
      orelse -
      Throws:
      Exception