* @throws java.io.IOException
*/
public void buildPacket(Packet packet, DataInput dataIn) throws IOException {
super.buildPacket(packet, dataIn);
XATransactionInfo info = (XATransactionInfo) packet;
info.setType(dataIn.readByte());
switch (info.getType()) {
case TransactionType.START:
case TransactionType.PRE_COMMIT:
case TransactionType.COMMIT:
case TransactionType.RECOVER:
case TransactionType.ROLLBACK:
case TransactionType.END:
case TransactionType.FORGET:
case TransactionType.JOIN:
case TransactionType.COMMIT_ONE_PHASE:
info.setXid(ActiveMQXid.read(dataIn));
break;
case TransactionType.SET_TX_TIMEOUT:
info.setTransactionTimeout(dataIn.readInt());
break;
case TransactionType.XA_RECOVER:
//recover should take a flag.
break;
case TransactionType.GET_TX_TIMEOUT:
case TransactionType.GET_RM_ID:
break;
default:
throw new IllegalArgumentException("Invalid type code: " + info.getType());
}
}