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 ProducerAckMarshaller extends BaseCommandMarshaller { 42 43 47 public byte getDataStructureType() { 48 return ProducerAck.DATA_STRUCTURE_TYPE; 49 } 50 51 54 public DataStructure createObject() { 55 return new ProducerAck(); 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 ProducerAck info = (ProducerAck)o; 69 info.setProducerId((org.apache.activemq.command.ProducerId) tightUnmarsalNestedObject(wireFormat, dataIn, bs)); 70 info.setSize(dataIn.readInt()); 71 72 } 73 74 75 78 public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { 79 80 ProducerAck info = (ProducerAck)o; 81 82 int rc = super.tightMarshal1(wireFormat, o, bs); 83 rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getProducerId(), bs); 84 85 return rc + 4; 86 } 87 88 95 public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs) throws IOException { 96 super.tightMarshal2(wireFormat, o, dataOut, bs); 97 98 ProducerAck info = (ProducerAck)o; 99 tightMarshalNestedObject2(wireFormat, (DataStructure)info.getProducerId(), dataOut, bs); 100 dataOut.writeInt(info.getSize()); 101 102 } 103 104 111 public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn) throws IOException { 112 super.looseUnmarshal(wireFormat, o, dataIn); 113 114 ProducerAck info = (ProducerAck)o; 115 info.setProducerId((org.apache.activemq.command.ProducerId) looseUnmarsalNestedObject(wireFormat, dataIn)); 116 info.setSize(dataIn.readInt()); 117 118 } 119 120 121 124 public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException { 125 126 ProducerAck info = (ProducerAck)o; 127 128 super.looseMarshal(wireFormat, o, dataOut); 129 looseMarshalNestedObject(wireFormat, (DataStructure)info.getProducerId(), dataOut); 130 dataOut.writeInt(info.getSize()); 131 132 } 133 } 134 | Popular Tags |