KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > activemq > command > JournalTransaction


1 /**
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one or more
4  * contributor license agreements. See the NOTICE file distributed with
5  * this work for additional information regarding copyright ownership.
6  * The ASF licenses this file to You under the Apache License, Version 2.0
7  * (the "License"); you may not use this file except in compliance with
8  * the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18 package org.apache.activemq.command;
19
20 import org.apache.activemq.util.IntrospectionSupport;
21
22
23 /**
24  * @openwire:marshaller code="54"
25  */

26 public class JournalTransaction implements DataStructure {
27     
28     public static final byte DATA_STRUCTURE_TYPE=CommandTypes.JOURNAL_TRANSACTION;
29
30     public static final byte XA_PREPARE=1;
31     public static final byte XA_COMMIT=2;
32     public static final byte XA_ROLLBACK=3;
33     public static final byte LOCAL_COMMIT=4;
34     public static final byte LOCAL_ROLLBACK=5;
35     
36     public byte type;
37     public boolean wasPrepared;
38     public TransactionId transactionId;
39     
40     public byte getDataStructureType() {
41         return DATA_STRUCTURE_TYPE;
42     }
43
44     public JournalTransaction(byte type, TransactionId transactionId, boolean wasPrepared) {
45         this.type = type;
46         this.transactionId = transactionId;
47         this.wasPrepared=wasPrepared;
48     }
49     
50     public JournalTransaction() {
51     }
52
53     /**
54      * @openwire:property version=1
55      */

56     public TransactionId getTransactionId() {
57         return transactionId;
58     }
59     
60     public void setTransactionId(TransactionId transactionId) {
61         this.transactionId = transactionId;
62     }
63
64     /**
65      * @openwire:property version=1
66      */

67     public byte getType() {
68         return type;
69     }
70     public void setType(byte type) {
71         this.type = type;
72     }
73
74     /**
75      * @openwire:property version=1
76      */

77     public boolean getWasPrepared() {
78         return wasPrepared;
79     }
80     
81     public void setWasPrepared(boolean wasPrepared) {
82         this.wasPrepared = wasPrepared;
83     }
84
85     public boolean isMarshallAware() {
86         return false;
87     }
88     
89     public String JavaDoc toString() {
90         return IntrospectionSupport.toString(this, JournalTransaction.class);
91     }
92 }
93
Popular Tags