1 18 19 package org.apache.activemq.openwire.v2; 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 MessagePullMarshaller extends BaseCommandMarshaller { 42 43 47 public byte getDataStructureType() { 48 return MessagePull.DATA_STRUCTURE_TYPE; 49 } 50 51 54 public DataStructure createObject() { 55 return new MessagePull(); 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 MessagePull info = (MessagePull)o; 69 info.setConsumerId((org.apache.activemq.command.ConsumerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); 70 info.setDestination((org.apache.activemq.command.ActiveMQDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); 71 info.setTimeout(tightUnmarshalLong(wireFormat, dataIn, bs)); 72 73 } 74 75 76 79 public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { 80 81 MessagePull info = (MessagePull)o; 82 83 int rc = super.tightMarshal1(wireFormat, o, bs); 84 rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getConsumerId(), bs); 85 rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getDestination(), bs); 86 rc+=tightMarshalLong1(wireFormat, info.getTimeout(), bs); 87 88 return rc + 0; 89 } 90 91 98 public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs) throws IOException { 99 super.tightMarshal2(wireFormat, o, dataOut, bs); 100 101 MessagePull info = (MessagePull)o; 102 tightMarshalCachedObject2(wireFormat, (DataStructure)info.getConsumerId(), dataOut, bs); 103 tightMarshalCachedObject2(wireFormat, (DataStructure)info.getDestination(), dataOut, bs); 104 tightMarshalLong2(wireFormat, info.getTimeout(), dataOut, bs); 105 106 } 107 108 115 public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn) throws IOException { 116 super.looseUnmarshal(wireFormat, o, dataIn); 117 118 MessagePull info = (MessagePull)o; 119 info.setConsumerId((org.apache.activemq.command.ConsumerId) looseUnmarsalCachedObject(wireFormat, dataIn)); 120 info.setDestination((org.apache.activemq.command.ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn)); 121 info.setTimeout(looseUnmarshalLong(wireFormat, dataIn)); 122 123 } 124 125 126 129 public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException { 130 131 MessagePull info = (MessagePull)o; 132 133 super.looseMarshal(wireFormat, o, dataOut); 134 looseMarshalCachedObject(wireFormat, (DataStructure)info.getConsumerId(), dataOut); 135 looseMarshalCachedObject(wireFormat, (DataStructure)info.getDestination(), dataOut); 136 looseMarshalLong(wireFormat, info.getTimeout(), dataOut); 137 138 } 139 } 140 | Popular Tags |