KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > tm > usertx > interfaces > UserTransactionSession


1 /*
2 * JBoss, Home of Professional Open Source
3 * Copyright 2005, JBoss Inc., and individual contributors as indicated
4 * by the @authors tag. See the copyright.txt in the distribution for a
5 * full listing of individual contributors.
6 *
7 * This is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License as
9 * 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 org.jboss.tm.usertx.interfaces;
23
24 import java.rmi.Remote JavaDoc;
25 import java.rmi.RemoteException JavaDoc;
26
27 import javax.transaction.UserTransaction JavaDoc;
28 import javax.transaction.NotSupportedException JavaDoc;
29 import javax.transaction.SystemException JavaDoc;
30 import javax.transaction.RollbackException JavaDoc;
31 import javax.transaction.HeuristicMixedException JavaDoc;
32 import javax.transaction.HeuristicRollbackException JavaDoc;
33
34
35 /**
36  * The RMI remote UserTransaction session interface.
37  *
38  * @author <a HREF="mailto:osh@sparre.dk">Ole Husgaard</a>
39  * @version $Revision: 37459 $
40  */

41 public interface UserTransactionSession
42    extends Remote JavaDoc
43 {
44    /**
45     * Destroy this session.
46     */

47    public void destroy()
48       throws RemoteException JavaDoc;
49
50    /**
51     * Start a new transaction, and return its TPC.
52     *
53     * @param timeout The timeout value for the new transaction, in seconds.
54     *
55     * @return The transaction propagation context for the new transaction.
56     */

57    public Object JavaDoc begin(int timeout)
58       throws RemoteException JavaDoc,
59              NotSupportedException JavaDoc,
60              SystemException JavaDoc;
61
62    /**
63     * Commit the transaction.
64     *
65     * @param tpc The transaction propagation context for the transaction.
66     */

67    public void commit(Object JavaDoc tpc)
68       throws RemoteException JavaDoc,
69              RollbackException JavaDoc,
70              HeuristicMixedException JavaDoc,
71              HeuristicRollbackException JavaDoc,
72              SecurityException JavaDoc,
73              IllegalStateException JavaDoc,
74              SystemException JavaDoc;
75
76    /**
77     * Rollback the transaction.
78     *
79     * @param tpc The transaction propagation context for the transaction.
80     */

81    public void rollback(Object JavaDoc tpc)
82       throws RemoteException JavaDoc,
83              SecurityException JavaDoc,
84              IllegalStateException JavaDoc,
85              SystemException JavaDoc;
86
87    /**
88     * Mark the transaction for rollback only.
89     *
90     * @param tpc The transaction propagation context for the transaction.
91     */

92    public void setRollbackOnly(Object JavaDoc tpc)
93       throws RemoteException JavaDoc,
94              IllegalStateException JavaDoc,
95              SystemException JavaDoc;
96    
97    /**
98     * Return status of the transaction.
99     *
100     * @param tpc The transaction propagation context for the transaction.
101     */

102    public int getStatus(Object JavaDoc tpc)
103       throws RemoteException JavaDoc,
104              SystemException JavaDoc;
105 }
106
Popular Tags