KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > speedo > jca > XAContext


1 /**
2  * Copyright (C) 2001-2004 France Telecom R&D
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  */

18 package org.objectweb.speedo.jca;
19
20 import org.objectweb.speedo.pm.api.ProxyManager;
21 import javax.transaction.xa.Xid JavaDoc;
22
23 /**
24  * It represents a XA context. An XAContext is linked to a XA transaction
25  * represented by a XID. In a transaction the same ProxyManager is used.
26  *
27  * @author S.Chassande-Barrioz
28  */

29 public class XAContext {
30     /**
31      * Is a possible status of the XAContext.
32      * It represents the initial state when the XAContext is not yet linked to a
33      * transaction. Then the PM must not be used in this state.
34      */

35     public final static byte UNKNOWN = -1;
36
37     /**
38      * Is a possible status of the XAContext.
39      * The start() method has been called in order to demarcate the begin of the
40      * PM use.
41      */

42     public final static byte STARTED = 1;
43
44     /**
45      * Is a possible status of the XAContext.
46      * The end() method has been called in order to demarcate the end of the
47      * PM use.
48      */

49     public final static byte ENDED = 2;
50
51     /**
52      * Is a possible status of the XAContext.
53      * The prepare() method has been called in order to launch the first step
54      * of the two phase commit. The PM must not be used in this state.
55      */

56     public final static byte PREPARED = 3;
57
58     /**
59      * The XID of the transaction
60      */

61     public Xid JavaDoc xid = null;
62
63     /**
64      * Is the ProxyManager to use in the XAContext (~transaction)
65      */

66     public ProxyManager pm = null;
67
68     /**
69      * is the status of the XAContext. The possible values are UNKNOWN, STARTED,
70      * ENDED or PREPARED.
71      */

72     public byte status = UNKNOWN;
73
74     /**
75      * This boolean indicates if the used PM has been registered as a
76      * java.transaction.Synchronization on the transaction.
77      */

78     public boolean synchroRegistred = false;
79
80     public XAContext(Xid JavaDoc xid) {
81         this.xid = xid;
82     }
83 }
84
Popular Tags