docs: public int replay_completion() throws NotPrepared
      {
          if (tc.isEntryEnabled())
              Tr.entry(tc, "replay_completion");
  
          int result = Status.STATUS_ROLLEDBACK;
  
          final int status = _transaction.getStatus();
  
          final int numberOfResources = _transaction.getResources().numRegistered();
  
          if (tc.isDebugEnabled())
              Tr.debug(tc, "replay_completion status:" + status);
  
          switch (status)
          {
          // If the transaction is still active, raise the NotPrepared exception.
          // The transaction must be marked rollback-only at this point because we
          // cannot allow the transaction to complete if a participant has failed.
              case javax.transaction.Status.STATUS_ACTIVE:
                  try
                  {
                      _transaction.setRollbackOnly();
                  } catch (Throwable exc)
                  {
                      FFDCFilter.processException(exc, "com.ibm.tx.remote.TransactionWrapper.replay_completion", "171", this);
                      if (tc.isEventEnabled())
                          Tr.event(tc, "replay_completion caught exception setting coordinator rollback_only", exc);
                  }
              case javax.transaction.Status.STATUS_MARKED_ROLLBACK:
                  final NotPrepared npe = new NotPrepared();
                  if (tc.isEntryEnabled())
                      Tr.exit(tc, "replay_completion", npe);
                  throw npe;
  
                  // If the transaction is prepared, the caller must wait for the
                  // Coordinator to tell it what to do, so return an unknown status, and
                  // do nothing.  Note that if this Coordinator is sitting waiting for
                  // its superior, this could take a long time.
              case javax.transaction.Status.STATUS_PREPARED:
                  result = Status.STATUS_UNKNOWN;
                  break;
  
              case javax.transaction.Status.STATUS_PREPARING:
                  if (numberOfResources == 1)
                  {
                      // There is only 1 resource registered and it is the caller so
                      // we will be issuing commit_one_phase to it, ie will have delegated
                      // responsibility to it to complete the txn, so we "no longer exist"
                      // as part of the transaction, so raise object_not_exist.
                      final OBJECT_NOT_EXIST one = new OBJECT_NOT_EXIST();
                      if (tc.isEntryEnabled())
                          Tr.exit(tc, "replay_completion", one);
                      throw one;
                  }
                  result = Status.STATUS_UNKNOWN;
                  break;
  
              // If the transaction has been committed, the caller will receive a commit.
              case javax.transaction.Status.STATUS_COMMITTING:
                  result = Status.STATUS_COMMITTING;
                  break;
  
              case javax.transaction.Status.STATUS_COMMITTED:
                  if (numberOfResources == 1)
                  {
                      // There is only 1 resource registered and it is the caller so
                      // we have issued commit_one_phase to it, ie will have delegated
                      // responsibility to it to complete the txn, so we "no longer exist"
                      // as part of the transaction, so raise object_not_exist.
                      final OBJECT_NOT_EXIST one = new OBJECT_NOT_EXIST();
                      if (tc.isEntryEnabled())
                          Tr.exit(tc, "replay_completion", one);
                      throw one;
                  }
                  result = Status.STATUS_COMMITTED;
                  break;
  
              case javax.transaction.Status.STATUS_NO_TRANSACTION:
                  result = Status.STATUS_NO_TRANSACTION;
                  break;
  
              case javax.transaction.Status.STATUS_ROLLEDBACK:
                  if (numberOfResources == 1)
                  {
                      // There is only 1 resource registered and it is the caller so
                      // we have issued commit_one_phase to it, ie will have delegated
                      // responsibility to it to complete the txn, so we "no longer exist"
                      // as part of the transaction, so raise object_not_exist.
                      final OBJECT_NOT_EXIST one = new OBJECT_NOT_EXIST();
                      if (tc.isEntryEnabled())
                          Tr.exit(tc, "replay_completion", one);
                      throw one;
                  }
  
                  // In any other situation, assume that the transaction has been rolled
                  // back. As there is a Coordinator, it will direct the Resource to roll
                  // back.
              default:
                  result = Status.STATUS_ROLLEDBACK;
          }
  
          if (tc.isEntryEnabled())
              Tr.exit(tc, "replay_completion", result);
          return result;
      }