1 22 package org.jboss.test.recover.bean; 23 24 import javax.ejb.CreateException ; 25 import org.jboss.logging.Logger; 26 import org.jboss.test.util.ejb.EntitySupport; 27 28 34 public abstract class AccountBean 35 extends EntitySupport 36 { 37 private static transient Logger log = 38 Logger.getLogger(AccountBean.class); 39 40 public abstract String getName(); 41 public abstract void setName(String name); 42 public abstract int getBalance(); 43 public abstract void setBalance(int balance); 44 45 public String ejbCreate(String name, int initialBalance) 46 throws CreateException 47 { 48 this.setName(name); 49 this.setBalance(initialBalance); 50 log = Logger.getLogger(AccountBean.class.getName() + 51 "#" + name); 52 log.debug("ejbCreate(" + name + ", " + initialBalance + 53 "), ctx=" + entityCtx); 54 return null; 55 } 56 57 public void ejbPostCreate(String name, int initialBalance) 58 { 59 } 60 61 public void addToBalance(int delta) 62 { 63 this.setBalance(this.getBalance() + delta); 64 } 65 66 public void setRollbackOnly() 67 { 68 entityCtx.setRollbackOnly(); 69 } 70 71 } 72 | Popular Tags |