1 25 26 package org.objectweb.jonas.jtests.beans.beanexc; 27 28 import javax.ejb.EJBContext ; 29 import java.rmi.RemoteException ; 30 31 import org.objectweb.util.monolog.api.Logger; 32 import org.objectweb.util.monolog.api.BasicLevel; 33 34 38 public abstract class AccountCommon implements java.io.Serializable { 39 40 protected static Logger logger = null; 41 protected boolean iAmDestroyed = false; 42 43 public abstract void setBalance(long val); 44 public abstract EJBContext getContext(); 45 46 public void doAppException_1() throws AppException { 47 logger.log(BasicLevel.DEBUG, ""); 48 setBalance(5000); 49 throw new AppException("doAppException_1"); 50 } 51 52 public void doAppException_2(boolean rollflg) throws AppException { 53 logger.log(BasicLevel.DEBUG, ""); 54 setBalance(50); 55 if (rollflg) { 56 getContext().setRollbackOnly(); 57 } 58 throw new AppException("doAppException_2"); 59 } 60 61 public void doAppException_3() throws AppException { 62 logger.log(BasicLevel.DEBUG, ""); 63 throw new AppException("doAppException_3"); 64 } 65 66 public void doUncheckedException_1() { 67 logger.log(BasicLevel.DEBUG, ""); 68 int zero = 0; 69 iAmDestroyed = true; 70 float f = 10 / zero; 71 } 72 73 public void doUncheckedException_2() { 74 logger.log(BasicLevel.DEBUG, ""); 75 setBalance(1000); 76 int zero = 0; 77 iAmDestroyed = true; 78 float f = 10 / zero; 79 } 80 81 public void doUncheckedException_3() { 82 logger.log(BasicLevel.DEBUG, ""); 83 int zero = 0; 84 iAmDestroyed = true; 85 float f = 10 / zero; 86 } 87 88 public void doRemoteException_1() throws RemoteException { 89 logger.log(BasicLevel.DEBUG, ""); 90 setBalance(10); 91 iAmDestroyed = true; 92 throw new RemoteException ("RemoteException in doRemoteException_1"); 93 } 94 95 public void doEJBException_1() { 96 logger.log(BasicLevel.DEBUG, ""); 97 setBalance(10); 98 iAmDestroyed = true; 99 throw new javax.ejb.EJBException ("EJBException in doEJBException_1"); 100 } 101 102 public void doEJBException_2() { 103 logger.log(BasicLevel.DEBUG, ""); 104 setBalance(10); 105 iAmDestroyed = true; 106 throw new javax.ejb.EJBException ("EJBException in doEJBException_2"); 107 } 108 109 public void doEJBException_sup() { 110 logger.log(BasicLevel.DEBUG, ""); 111 setBalance(10); 112 iAmDestroyed = true; 113 throw new javax.ejb.EJBException ("EJBException in doEJBException_sup"); 114 } 115 116 public boolean iAmDestroyed() { 117 logger.log(BasicLevel.DEBUG, ""); 118 return iAmDestroyed; 119 } 120 121 public void ping() { 122 logger.log(BasicLevel.DEBUG, ""); 123 } 124 125 public void ejbPostCreate(int flag) { 126 } 127 128 public void ejbPostCreate(boolean flag) { 129 } 130 131 } 132 | Popular Tags |