break;
case PREPARE:
final int rt = this.processor.prepareTransaction(context, xid);
// prepare����践��
RemotingUtils.response(conn,
new BooleanCommand(HttpStatus.Success, String.valueOf(rt), request.getOpaque()));
break;
// �ύ��,forget��rollback��ʱ����ͬ�����ã������ҪӦ��
case COMMIT_ONE_PHASE:
this.processor.commitTransaction(context, xid, true);
this.responseOK(request, conn);
break;
case COMMIT_TWO_PHASE:
this.processor.commitTransaction(context, xid, false);
this.responseOK(request, conn);
break;
case FORGET:
this.processor.forgetTransaction(context, xid);
this.responseOK(request, conn);
break;
case ROLLBACK:
this.processor.rollbackTransaction(context, xid);
this.responseOK(request, conn);
break;
case RECOVER:
final TransactionId[] xids =
this.processor.getPreparedTransactions(context, request.getTransactionInfo()
.getUniqueQualifier());
final StringBuilder sb = new StringBuilder();
boolean wasFirst = true;
for (final TransactionId id : xids) {
if (wasFirst) {
sb.append(id.getTransactionKey());
wasFirst = false;
}
else {
sb.append("\r\n").append(id.getTransactionKey());
}
}
RemotingUtils
.response(conn, new BooleanCommand(HttpStatus.Success, sb.toString(), request.getOpaque()));
break;
default:
RemotingUtils.response(conn, new BooleanCommand(HttpStatus.InternalServerError, "Unknow transaction command type:" + request.getTransactionInfo().getType(),
request.getOpaque()));
}
}
catch (final XAException e) {