Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: org/activemq/transport/openwire/io/ActiveMQMessageMarshaller.java


1   /**
2    * Marshalling code for Open Wire Format for ActiveMQMessage
3    *
4    *
5    * NOTE!: This file is autogenerated - do not modify!
6    *        if you need to make a change, please see the Groovy scripts in the
7    *        activemq-openwire module
8    */
9   
10  package org.activemq.transport.openwire.io;
11  
12  import java.io.DataInput;
13  import java.io.DataOutput;
14  import java.io.IOException;
15  
16  import org.activemq.message.*;
17  import org.activemq.io.*;
18  import org.activemq.io.impl.*;
19  import org.activemq.transport.openwire.OpenWirePacketMarshallerSupport;
20  
21  /**
22   * AUTOGENERATED Marshaller for OpenWire command ActiveMQMessage
23   *
24   * @version $Revision: 1.1 $
25   */
26  public class ActiveMQMessageMarshaller extends OpenWirePacketMarshallerSupport {
27  
28      /**
29       * Return the type of Packet
30       *
31       * @return integer representation of the type of Packet
32       */
33      public int getPacketType() {
34          return 16;
35      }
36  
37      /**
38       * @return a new Packet instance
39       */
40      public Packet createPacket() {
41          return new ActiveMQMessage();
42      }
43  
44      /**
45       * build a Packet instance from the data input stream
46       *
47       * @param packet A Packet object
48       * @param dataIn the data input stream to build the packet from
49       * @throws IOException
50       */
51      public void buildPacket(Packet packet, DataInput dataIn) throws IOException {
52          super.buildPacket(packet, dataIn);
53          ActiveMQMessage info = (ActiveMQMessage) packet;
54          info.setConsumerNosAsString(readString(dataIn));
55          info.setJMSMessageID(readString(dataIn));
56          info.setJMSTimestamp(dataIn.readLong());
57          info.setJMSCorrelationID(readString(dataIn));
58          info.setJMSReplyTo(readDestination(dataIn));
59          info.setJMSDestination(readDestination(dataIn));
60          info.setJMSDeliveryMode(dataIn.readInt());
61          info.setJMSRedelivered(dataIn.readBoolean());
62          info.setJMSType(readString(dataIn));
63          info.setJMSExpiration(dataIn.readLong());
64          info.setJMSPriority(dataIn.readInt());
65          info.setProperties(readProperties(dataIn));
66          info.setEntryBrokerName(readString(dataIn));
67          info.setEntryClusterName(readString(dataIn));
68          info.setJMSClientID(readString(dataIn));
69          info.setSequenceNumber(dataIn.readLong());
70          info.setDeliveryCount(dataIn.readInt());
71          info.setDispatchedFromDLQ(dataIn.readBoolean());
72          info.setMesssageHandle(dataIn.readShort());
73          info.setExternalMessageId(dataIn.readBoolean());
74          info.setProducerKey(readString(dataIn));
75          info.setMessagePart(dataIn.readBoolean());
76          info.setNumberOfParts(dataIn.readShort());
77          info.setPartNumber(dataIn.readShort());
78          info.setParentMessageID(readString(dataIn));
79          info.setTransactionIDString(readString(dataIn));
80  
81      }
82  
83      /**
84       * Write a Packet instance to data output stream
85       *
86       * @param packet  the instance to be seralized
87       * @param dataOut the output stream
88       * @throws IOException thrown if an error occurs
89       */
90      public void writePacket(Packet packet, DataOutput dataOut) throws IOException {
91          super.writePacket(packet, dataOut);
92          ActiveMQMessage info = (ActiveMQMessage) packet;
93          writeString(info.getConsumerNosAsString(), dataOut);
94          writeString(info.getJMSMessageID(), dataOut);
95          dataOut.writeLong(info.getJMSTimestamp());
96          writeString(info.getJMSCorrelationID(), dataOut);
97          writeDestination(info.getJMSReplyTo(), dataOut);
98          writeDestination(info.getJMSDestination(), dataOut);
99          dataOut.writeInt(info.getJMSDeliveryMode());
100         dataOut.writeBoolean(info.getJMSRedelivered());
101         writeString(info.getJMSType(), dataOut);
102         dataOut.writeLong(info.getJMSExpiration());
103         dataOut.writeInt(info.getJMSPriority());
104         writeProperties(info.getProperties(), dataOut);
105         writeString(info.getEntryBrokerName(), dataOut);
106         writeString(info.getEntryClusterName(), dataOut);
107         writeString(info.getJMSClientID(), dataOut);
108         dataOut.writeLong(info.getSequenceNumber());
109         dataOut.writeInt(info.getDeliveryCount());
110         dataOut.writeBoolean(info.isDispatchedFromDLQ());
111         dataOut.writeShort(info.getMesssageHandle());
112         dataOut.writeBoolean(info.isExternalMessageId());
113         writeString(info.getProducerKey(), dataOut);
114         dataOut.writeBoolean(info.isMessagePart());
115         dataOut.writeShort(info.getNumberOfParts());
116         dataOut.writeShort(info.getPartNumber());
117         writeString(info.getParentMessageID(), dataOut);
118         writeString(info.getTransactionIDString(), dataOut);
119 
120     }
121 }