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 MessageDispatchNotificationMarshaller extends BaseCommandMarshaller { 42 43 47 public byte getDataStructureType() { 48 return MessageDispatchNotification.DATA_STRUCTURE_TYPE; 49 } 50 51 54 public DataStructure createObject() { 55 return new MessageDispatchNotification(); 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 MessageDispatchNotification info = (MessageDispatchNotification)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.setDeliverySequenceId(tightUnmarshalLong(wireFormat, dataIn, bs)); 72 info.setMessageId((org.apache.activemq.command.MessageId) tightUnmarsalNestedObject(wireFormat, dataIn, bs)); 73 74 } 75 76 77 80 public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { 81 82 MessageDispatchNotification info = (MessageDispatchNotification)o; 83 84 int rc = super.tightMarshal1(wireFormat, o, bs); 85 rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getConsumerId(), bs); 86 rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getDestination(), bs); 87 rc+=tightMarshalLong1(wireFormat, info.getDeliverySequenceId(), bs); 88 rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getMessageId(), bs); 89 90 return rc + 0; 91 } 92 93 100 public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs) throws IOException { 101 super.tightMarshal2(wireFormat, o, dataOut, bs); 102 103 MessageDispatchNotification info = (MessageDispatchNotification)o; 104 tightMarshalCachedObject2(wireFormat, (DataStructure)info.getConsumerId(), dataOut, bs); 105 tightMarshalCachedObject2(wireFormat, (DataStructure)info.getDestination(), dataOut, bs); 106 tightMarshalLong2(wireFormat, info.getDeliverySequenceId(), dataOut, bs); 107 tightMarshalNestedObject2(wireFormat, (DataStructure)info.getMessageId(), dataOut, bs); 108 109 } 110 111 118 public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn) throws IOException { 119 super.looseUnmarshal(wireFormat, o, dataIn); 120 121 MessageDispatchNotification info = (MessageDispatchNotification)o; 122 info.setConsumerId((org.apache.activemq.command.ConsumerId) looseUnmarsalCachedObject(wireFormat, dataIn)); 123 info.setDestination((org.apache.activemq.command.ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn)); 124 info.setDeliverySequenceId(looseUnmarshalLong(wireFormat, dataIn)); 125 info.setMessageId((org.apache.activemq.command.MessageId) looseUnmarsalNestedObject(wireFormat, dataIn)); 126 127 } 128 129 130 133 public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException { 134 135 MessageDispatchNotification info = (MessageDispatchNotification)o; 136 137 super.looseMarshal(wireFormat, o, dataOut); 138 looseMarshalCachedObject(wireFormat, (DataStructure)info.getConsumerId(), dataOut); 139 looseMarshalCachedObject(wireFormat, (DataStructure)info.getDestination(), dataOut); 140 looseMarshalLong(wireFormat, info.getDeliverySequenceId(), dataOut); 141 looseMarshalNestedObject(wireFormat, (DataStructure)info.getMessageId(), dataOut); 142 143 } 144 } 145 | Popular Tags |