1 18 19 package org.apache.activemq.openwire.v1; 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 ReplayCommandMarshaller extends BaseCommandMarshaller { 42 43 47 public byte getDataStructureType() { 48 return ReplayCommand.DATA_STRUCTURE_TYPE; 49 } 50 51 54 public DataStructure createObject() { 55 return new ReplayCommand(); 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 ReplayCommand info = (ReplayCommand)o; 69 info.setFirstNakNumber(dataIn.readInt()); 70 info.setLastNakNumber(dataIn.readInt()); 71 72 } 73 74 75 78 public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { 79 80 ReplayCommand info = (ReplayCommand)o; 81 82 int rc = super.tightMarshal1(wireFormat, o, bs); 83 84 return rc + 8; 85 } 86 87 94 public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs) throws IOException { 95 super.tightMarshal2(wireFormat, o, dataOut, bs); 96 97 ReplayCommand info = (ReplayCommand)o; 98 dataOut.writeInt(info.getFirstNakNumber()); 99 dataOut.writeInt(info.getLastNakNumber()); 100 101 } 102 103 110 public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn) throws IOException { 111 super.looseUnmarshal(wireFormat, o, dataIn); 112 113 ReplayCommand info = (ReplayCommand)o; 114 info.setFirstNakNumber(dataIn.readInt()); 115 info.setLastNakNumber(dataIn.readInt()); 116 117 } 118 119 120 123 public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException { 124 125 ReplayCommand info = (ReplayCommand)o; 126 127 super.looseMarshal(wireFormat, o, dataOut); 128 dataOut.writeInt(info.getFirstNakNumber()); 129 dataOut.writeInt(info.getLastNakNumber()); 130 131 } 132 } 133 | Popular Tags |