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/XATransactionInfoMarshaller.java


1   /**
2    * Marshalling code for Open Wire Format for XATransactionInfo
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 XATransactionInfo
23   *
24   * @version $Revision: 1.1 $
25   */
26  public class XATransactionInfoMarshaller 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 24;
35      }
36  
37      /**
38       * @return a new Packet instance
39       */
40      public Packet createPacket() {
41          return new XATransactionInfo();
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          XATransactionInfo info = (XATransactionInfo) packet;
54          info.setType(dataIn.readInt());
55          info.setXid((org.activemq.message.ActiveMQXid) readObject(dataIn));
56          info.setTransactionTimeout(dataIn.readInt());
57  
58      }
59  
60      /**
61       * Write a Packet instance to data output stream
62       *
63       * @param packet  the instance to be seralized
64       * @param dataOut the output stream
65       * @throws IOException thrown if an error occurs
66       */
67      public void writePacket(Packet packet, DataOutput dataOut) throws IOException {
68          super.writePacket(packet, dataOut);
69          XATransactionInfo info = (XATransactionInfo) packet;
70          dataOut.writeInt(info.getType());
71          writeObject(info.getXid(), dataOut);
72          dataOut.writeInt(info.getTransactionTimeout());
73  
74      }
75  }