KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > commons > transaction > util > xa > TransactionalResource


1 /*
2  * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//transaction/src/java/org/apache/commons/transaction/util/xa/TransactionalResource.java,v 1.1 2004/11/18 23:27:19 ozeigermann Exp $
3 <<<<<<< .mine
4  * $Revision: 1.1 $
5  * $Date: 2005-02-26 14:16:14 +0100 (Sa, 26 Feb 2005) $
6 =======
7  * $Revision$
8  * $Date: 2005-02-26 14:16:14 +0100 (Sa, 26 Feb 2005) $
9 >>>>>>> .r168169
10  *
11  * ====================================================================
12  *
13  * Copyright 2004 The Apache Software Foundation
14  *
15  * Licensed under the Apache License, Version 2.0 (the "License");
16  * you may not use this file except in compliance with the License.
17  * You may obtain a copy of the License at
18  *
19  * http://www.apache.org/licenses/LICENSE-2.0
20  *
21  * Unless required by applicable law or agreed to in writing, software
22  * distributed under the License is distributed on an "AS IS" BASIS,
23  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24  * See the License for the specific language governing permissions and
25  * limitations under the License.
26  *
27  */

28
29 package org.apache.commons.transaction.util.xa;
30
31 import javax.transaction.xa.XAException JavaDoc;
32 import javax.transaction.xa.Xid JavaDoc;
33
34 /**
35  * Interface for something that makes up a transactional resource.
36  */

37 public interface TransactionalResource {
38
39     /**
40      * Commits the changes done inside this transaction reasource. This can mean
41      * to call commit on a connection associated to the resource or any other
42      * action that needs to be taken to make changes in this resource permanent.
43      *
44      * @throws XAException
45      * when anything goes wrong the error must be described in XA
46      * notation
47      */

48     public void commit() throws XAException JavaDoc;
49
50     /**
51      * Prepares the changes done inside this transaction reasource. Same
52      * semantics as {@link XAResource.prepare(Xid)}.
53      *
54      * @throws XAException
55      * when anything goes wrong the error must be described in XA
56      * notation
57      */

58     public int prepare() throws XAException JavaDoc;
59
60     /**
61      * Rolls back the changes done inside this transaction reasource. This can mean
62      * to call roll back on a connection associated to the resource or any other
63      * action that needs to be taken to undo the changes in this resource permanent.
64      *
65      * @throws XAException
66      * when anything goes wrong the error must be described in XA
67      * notation
68      */

69     public void rollback() throws XAException JavaDoc;
70     
71     public void begin() throws XAException JavaDoc;
72     public void suspend() throws XAException JavaDoc;
73     public void resume() throws XAException JavaDoc;
74
75     /**
76      * Returns the current status of this transaction resource.
77      *
78      * @return the current status of this resource as defined by {@link Status}.
79      */

80     public int getStatus();
81
82     /**
83      * Sets the status of this transctional resource. The status set by this method
84      * must be available over {@link #getStatus()} afterwards.
85      * @param status the status to be set
86      */

87     public void setStatus(int status);
88
89     /**
90      * Returns the Xid this transctional resource is associated with. This might have been set in
91      * the constructor of implementing classes.
92      *
93      * @return the xid this transctional resource is associated with
94      */

95     public Xid JavaDoc getXid();
96 }
Popular Tags