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