1 18 19 package org.apache.activemq.openwire.v3; 20 21 import java.io.DataInput ; 22 import java.io.DataOutput ; 23 import java.io.IOException ; 24 25 import org.apache.activemq.openwire.*; 26 import org.apache.activemq.command.*; 27 28 29 30 41 public class TransactionInfoMarshaller extends BaseCommandMarshaller { 42 43 47 public byte getDataStructureType() { 48 return TransactionInfo.DATA_STRUCTURE_TYPE; 49 } 50 51 54 public DataStructure createObject() { 55 return new TransactionInfo(); 56 } 57 58 65 public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs) throws IOException { 66 super.tightUnmarshal(wireFormat, o, dataIn, bs); 67 68 TransactionInfo info = (TransactionInfo)o; 69 info.setConnectionId((org.apache.activemq.command.ConnectionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); 70 info.setTransactionId((org.apache.activemq.command.TransactionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); 71 info.setType(dataIn.readByte()); 72 73 } 74 75 76 79 public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { 80 81 TransactionInfo info = (TransactionInfo)o; 82 83 int rc = super.tightMarshal1(wireFormat, o, bs); 84 rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getConnectionId(), bs); 85 rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getTransactionId(), bs); 86 87 return rc + 1; 88 } 89 90 97 public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs) throws IOException { 98 super.tightMarshal2(wireFormat, o, dataOut, bs); 99 100 TransactionInfo info = (TransactionInfo)o; 101 tightMarshalCachedObject2(wireFormat, (DataStructure)info.getConnectionId(), dataOut, bs); 102 tightMarshalCachedObject2(wireFormat, (DataStructure)info.getTransactionId(), dataOut, bs); 103 dataOut.writeByte(info.getType()); 104 105 } 106 107 114 public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn) throws IOException { 115 super.looseUnmarshal(wireFormat, o, dataIn); 116 117 TransactionInfo info = (TransactionInfo)o; 118 info.setConnectionId((org.apache.activemq.command.ConnectionId) looseUnmarsalCachedObject(wireFormat, dataIn)); 119 info.setTransactionId((org.apache.activemq.command.TransactionId) looseUnmarsalCachedObject(wireFormat, dataIn)); 120 info.setType(dataIn.readByte()); 121 122 } 123 124 125 128 public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException { 129 130 TransactionInfo info = (TransactionInfo)o; 131 132 super.looseMarshal(wireFormat, o, dataOut); 133 looseMarshalCachedObject(wireFormat, (DataStructure)info.getConnectionId(), dataOut); 134 looseMarshalCachedObject(wireFormat, (DataStructure)info.getTransactionId(), dataOut); 135 dataOut.writeByte(info.getType()); 136 137 } 138 } 139 | Popular Tags |