code: @Override
     public void remoteTransactionPrepared(GlobalTransaction gtx) {
        RecoveryAwareRemoteTransaction remoteTransaction =
              (RecoveryAwareRemoteTransaction) getRemoteTransaction(gtx);
        if (remoteTransaction == null)
           throw new CacheException(String.format(
                 "Remote transaction for global transaction (%s) not found", gtx));
        remoteTransaction.setPrepared(true);
     }
docs: Marks the transaction as prepared. If at a further point the originator fails, the transaction is removed form the
  "normal" transactions collection and moved into the cache that holds in-doubt transactions.
  See {@link #cleanupLeaverTransactions(java.util.List)}