KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > easybeans > tests > common > ejbs > stateful > beanmanaged > transaction > ItfBeanManagedException


1 /**
2  * EasyBeans
3  * Copyright (C) 2006 Bull S.A.S.
4  * Contact: easybeans@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  *
21  * --------------------------------------------------------------------------
22  * $Id: ItfBeanManagedException.java 989 2006-07-31 12:23:28Z pinheirg $
23  * --------------------------------------------------------------------------
24  */

25
26 package org.objectweb.easybeans.tests.common.ejbs.stateful.beanmanaged.transaction;
27
28 import java.sql.SQLException JavaDoc;
29
30 import javax.naming.NamingException JavaDoc;
31 import javax.transaction.HeuristicMixedException JavaDoc;
32 import javax.transaction.HeuristicRollbackException JavaDoc;
33 import javax.transaction.NotSupportedException JavaDoc;
34 import javax.transaction.RollbackException JavaDoc;
35 import javax.transaction.SystemException JavaDoc;
36
37 /**
38  * Used to test the Exceptions and the bean-managed transaction.
39  * @author Gisele Pinheiro Souza
40  * @author Eduardo Studzinski Estima de Castro
41  *
42  */

43 public interface ItfBeanManagedException {
44
45     /**
46      * The table name.
47      */

48      String JavaDoc TABLE = "SFSBBeanManagedException";
49
50      /**
51       * Creates an instance of the tableManager.
52       * @param dbName the database name.
53       * @throws NamingException if a lookup error occurs.
54       */

55      void startup(final String JavaDoc dbName) throws NamingException JavaDoc;
56
57     /**
58      * Begins a transaction, inserts the data in the database, throws an
59      * application exception and tries to commit.
60      * @throws SQLException if a database error occurs.
61      * @throws NamingException if a lookup error occurs.
62      * @throws SystemException if an unexpected error occurs.
63      * @throws NotSupportedException if the resquest cannot be made.
64      * @throws HeuristicRollbackException if a heuristic decision was made and
65      * some relevant update was rolled back.
66      * @throws RollbackException if the transaction was rolled back instead of
67      * committed.
68      * @throws HeuristicMixedException if a heuristic decision was made and some
69      * relevant update was commited and others rolled back.
70      * @throws IllegalStateException if the bean is not associated with a
71      * transaction.
72      * @throws SecurityException if the bean is not allowed to commit.
73      */

74     void insertTableWithAppException() throws NamingException JavaDoc, SQLException JavaDoc, NotSupportedException JavaDoc, SystemException JavaDoc,
75             IllegalStateException JavaDoc, SecurityException JavaDoc, HeuristicMixedException JavaDoc, HeuristicRollbackException JavaDoc, RollbackException JavaDoc;
76
77     /**
78      * Begins a transaction, inserts the data in the database, throws a
79      * runtime exception and tries to commit.
80      * @throws SQLException if a database error occurs.
81      * @throws NamingException if a lookup error occurs.
82      * @throws SystemException if an unexpected error occurs.
83      * @throws NotSupportedException if the resquest cannot be made.
84      * @throws HeuristicRollbackException if a heuristic decision was made and
85      * some relevant update was rolled back.
86      * @throws RollbackException if the transaction was rolled back instead of
87      * committed.
88      * @throws HeuristicMixedException if a heuristic decision was made and some
89      * relevant update was commited and others rolled back.
90      * @throws IllegalStateException if the bean is not associated with a
91      * transaction.
92      * @throws SecurityException if the bean is not allowed to commit.
93
94      */

95     void insertTableWithRuntimeException() throws NamingException JavaDoc, SQLException JavaDoc, NotSupportedException JavaDoc, SystemException JavaDoc,
96             IllegalStateException JavaDoc, SecurityException JavaDoc, HeuristicMixedException JavaDoc, HeuristicRollbackException JavaDoc, RollbackException JavaDoc;
97
98     /**
99      * Does nothing.
100      *
101      */

102     void emptyMethod();
103 }
104
Popular Tags