class JtaAfterCompletionMessage extends TXMessage {

  @Override
  protected boolean operateOnTx(TXId txId, ClusterDistributionManager dm)
      throws RemoteOperationException {
    TXManagerImpl txMgr = dm.getCache().getTXMgr();
    if (logger.isDebugEnabled()) {
      logger.debug("JTA: Calling afterCompletion for :{}", txId);
    }
    TXCommitMessage commitMessage = txMgr.getRecentlyCompletedMessage(txId);
    if (commitMessage != null) {
      TXCommitMessage message =
          commitMessage == TXCommitMessage.ROLLBACK_MSG ? null : commitMessage;
      TXRemoteCommitReplyMessage.send(getSender(), getProcessorId(), message, getReplySender(dm));
      return false;
    }
    TXStateProxy txState = txMgr.getTXState();
    txState.setCommitOnBehalfOfRemoteStub(true);
    txState.afterCompletion(status);
    commitMessage = txState.getCommitMessage();
    TXRemoteCommitReplyMessage.send(getSender(), getProcessorId(), commitMessage,
        getReplySender(dm));
    txMgr.removeHostedTXState(txId);
    return false;
  }

  public  JtaAfterCompletionMessage();
  public  JtaAfterCompletionMessage(int status, int txUniqId,
      InternalDistributedMember onBehalfOfClientMember, ReplyProcessor21 processor);

}