1 4 package com.tc.object.msg; 5 6 import com.tc.bytes.TCByteBuffer; 7 import com.tc.io.TCByteBufferOutput; 8 import com.tc.net.protocol.tcm.MessageChannel; 9 import com.tc.net.protocol.tcm.MessageMonitor; 10 import com.tc.net.protocol.tcm.TCMessageHeader; 11 import com.tc.net.protocol.tcm.TCMessageType; 12 import com.tc.object.session.SessionID; 13 import com.tc.object.tx.TxnBatchID; 14 15 import java.io.IOException ; 16 17 21 public class BatchTransactionAcknowledgeMessageImpl extends DSOMessageBase implements 22 BatchTransactionAcknowledgeMessage { 23 private static final byte BATCH_ID = 1; 24 25 private TxnBatchID batchID; 26 27 public BatchTransactionAcknowledgeMessageImpl(MessageMonitor monitor, TCByteBufferOutput out, MessageChannel channel, 28 TCMessageType type) { 29 super(monitor, out, channel, type); 30 } 31 32 public BatchTransactionAcknowledgeMessageImpl(SessionID sessionID, MessageMonitor monitor, MessageChannel channel, 33 TCMessageHeader header, TCByteBuffer[] data) { 34 super(sessionID, monitor, channel, header, data); 35 } 36 37 protected void dehydrateValues() { 38 putNVPair(BATCH_ID, batchID.toLong()); 39 } 40 41 protected boolean hydrateValue(byte name) throws IOException { 42 switch (name) { 43 case BATCH_ID: { 44 this.batchID = new TxnBatchID(getLongValue()); 45 return true; 46 } 47 default: { 48 return false; 49 } 50 } 51 } 52 53 public void initialize(TxnBatchID id) { 54 this.batchID = id; 55 } 56 57 public TxnBatchID getBatchID() { 58 return batchID; 59 } 60 } 61 | Popular Tags |