01: /*
02: * JBoss, Home of Professional Open Source.
03: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
04: * as indicated by the @author tags. See the copyright.txt file in the
05: * distribution for a full listing of individual contributors.
06: *
07: * This is free software; you can redistribute it and/or modify it
08: * under the terms of the GNU Lesser General Public License as
09: * published by the Free Software Foundation; either version 2.1 of
10: * the License, or (at your option) any later version.
11: *
12: * This software is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * Lesser General Public License for more details.
16: *
17: * You should have received a copy of the GNU Lesser General Public
18: * License along with this software; if not, write to the Free
19: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21: */
22: package javax.transaction.xa;
23:
24: /**
25: * The Xid interface is a Java mapping of the X/Open transaction identifier
26: * XID structure.
27: * <p>
28: * A transaction id is an aggregate of three parts:
29: * <ul>
30: * <li> The format identifier indicates the transaction family and tells
31: * how the other two parts should be interpreted.
32: * </li>
33: * <li> The global transaction id denotes, with the format specifier, the
34: * id of the global transaction.
35: * </li>
36: * <li> The branch qualifier denotes a particular branch of the global
37: * transaction.
38: * </li>
39: * </ul>
40: * <p>
41: * The Xid interface is used by the application server, the transaction manager
42: * and the resource managers, and is not used in application programs.
43: *
44: * @version $Revision: 57196 $
45: */
46: public interface Xid {
47: /**
48: * The maximum possible size of a global transaction id.
49: * This is the largest possible array returned by the
50: * {@link #getGlobalTransactionId() getGlobalTransactionId} method.
51: */
52: public static final int MAXGTRIDSIZE = 64;
53:
54: /**
55: * The maximum possible size of a transaction branch qualifier.
56: * This is the largest possible array returned by the
57: * {@link #getBranchQualifier() getBranchQualifier} method.
58: */
59: public static final int MAXBQUALSIZE = 64;
60:
61: /**
62: * Get the format identifier.
63: *
64: * @return An integer denoting the family of this transaction, and
65: * telling how the two other parts can be interpreted.
66: */
67: public int getFormatId();
68:
69: /**
70: * Get the global transaction id of this transaction.
71: *
72: * Please note that JTA does not define if this method returns
73: * a copy or a reference to an internal byte array. For maximum
74: * portability, do not modify the returned array.
75: *
76: * @return A byte array that together with the format ID
77: * defines the globally unique ID of this transaction.
78: */
79: public byte[] getGlobalTransactionId();
80:
81: /**
82: * Get the transaction branch qualifier of this transaction.
83: *
84: * Please note that JTA does not define if this method returns
85: * a copy or a reference to an internal byte array. For maximum
86: * portability, do not modify the returned array.
87: *
88: * @return A byte array that identifies the branch of this
89: * transaction.
90: */
91: public byte[] getBranchQualifier();
92: }
|