1 25 package org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.exception; 26 27 import java.sql.SQLException ; 28 29 import javax.ejb.Remote ; 30 import javax.ejb.Stateless ; 31 import javax.naming.NamingException ; 32 import javax.transaction.NotSupportedException ; 33 import javax.transaction.SystemException ; 34 35 import org.objectweb.easybeans.tests.common.db.TableManager; 36 import org.objectweb.easybeans.tests.common.exception.CustomException00; 37 import org.objectweb.easybeans.tests.common.exception.CustomException01; 38 import org.objectweb.easybeans.tests.common.exception.IllegalException; 39 import org.objectweb.easybeans.tests.common.exception.RollbackApplicationException; 40 41 47 @Stateless 48 @Remote (ItfExceptionXML.class) 49 public class SLSBExceptionXML implements ItfExceptionXML { 50 51 61 public void createTableWithAppException(final String dbName) throws NamingException , NotSupportedException , 62 SystemException , SQLException { 63 TableManager tableManager = new TableManager(dbName); 64 tableManager.insertTable(TABLE); 65 throw new CustomException01("The bean threw an application exception defined in the deployment descriptor."); 66 } 67 68 80 public void createTableWithAppExceptionAndRollback(final String dbName) throws NamingException , 81 NotSupportedException , SystemException , SQLException , CustomException00 { 82 TableManager tableManager = new TableManager(dbName); 83 tableManager.insertTable(TABLE); 84 throw new CustomException00("The bean threw an application exception defined in the deployment descriptor."); 85 } 86 87 97 public void createTableWithAppExceptionDefault(final String dbName) throws NamingException , NotSupportedException , 98 SystemException , SQLException { 99 TableManager tableManager = new TableManager(dbName); 100 tableManager.insertTable(TABLE); 101 throw new IllegalException("The bean threw an application exception defined in the deployment descriptor."); 102 } 103 104 116 public void createTableWithAppExceptionOverride(final String dbName) throws NamingException , NotSupportedException , 117 SystemException , SQLException , RollbackApplicationException { 118 TableManager tableManager = new TableManager(dbName); 119 tableManager.insertTable(TABLE); 120 throw new RollbackApplicationException("The bean threw an application exception defined by annotation."); 121 } 122 123 } 124 | Popular Tags |