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 SubscriptionInfoMarshaller extends BaseDataStreamMarshaller { 42 43 47 public byte getDataStructureType() { 48 return SubscriptionInfo.DATA_STRUCTURE_TYPE; 49 } 50 51 54 public DataStructure createObject() { 55 return new SubscriptionInfo(); 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 SubscriptionInfo info = (SubscriptionInfo)o; 69 info.setClientId(tightUnmarshalString(dataIn, bs)); 70 info.setDestination((org.apache.activemq.command.ActiveMQDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); 71 info.setSelector(tightUnmarshalString(dataIn, bs)); 72 info.setSubcriptionName(tightUnmarshalString(dataIn, bs)); 73 74 } 75 76 77 80 public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { 81 82 SubscriptionInfo info = (SubscriptionInfo)o; 83 84 int rc = super.tightMarshal1(wireFormat, o, bs); 85 rc += tightMarshalString1(info.getClientId(), bs); 86 rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getDestination(), bs); 87 rc += tightMarshalString1(info.getSelector(), bs); 88 rc += tightMarshalString1(info.getSubcriptionName(), 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 SubscriptionInfo info = (SubscriptionInfo)o; 104 tightMarshalString2(info.getClientId(), dataOut, bs); 105 tightMarshalCachedObject2(wireFormat, (DataStructure)info.getDestination(), dataOut, bs); 106 tightMarshalString2(info.getSelector(), dataOut, bs); 107 tightMarshalString2(info.getSubcriptionName(), 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 SubscriptionInfo info = (SubscriptionInfo)o; 122 info.setClientId(looseUnmarshalString(dataIn)); 123 info.setDestination((org.apache.activemq.command.ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn)); 124 info.setSelector(looseUnmarshalString(dataIn)); 125 info.setSubcriptionName(looseUnmarshalString(dataIn)); 126 127 } 128 129 130 133 public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException { 134 135 SubscriptionInfo info = (SubscriptionInfo)o; 136 137 super.looseMarshal(wireFormat, o, dataOut); 138 looseMarshalString(info.getClientId(), dataOut); 139 looseMarshalCachedObject(wireFormat, (DataStructure)info.getDestination(), dataOut); 140 looseMarshalString(info.getSelector(), dataOut); 141 looseMarshalString(info.getSubcriptionName(), dataOut); 142 143 } 144 } 145 | Popular Tags |