1 22 package org.jboss.test.cts.ejb; 23 24 import java.rmi.RemoteException ; 25 import javax.ejb.EntityBean ; 26 import javax.ejb.EntityContext ; 27 import javax.ejb.CreateException ; 28 import javax.ejb.DuplicateKeyException ; 29 import javax.ejb.EJBException ; 30 31 32 import org.jboss.test.cts.keys.AccountPK; 33 import org.jboss.logging.Logger; 34 35 40 public abstract class CtsCmpBean 41 implements EntityBean 42 { 43 static Logger log = Logger.getLogger(CtsCmpBean.class); 44 private EntityContext ctx = null; 45 46 public AccountPK ejbCreate(AccountPK pk, String personsName) 47 throws CreateException , DuplicateKeyException 48 { 49 log.debug("entry ejbCreate, pk=" + pk); 50 setPk(pk); 51 setPersonsName(personsName); 52 return null; 53 } 54 55 public void ejbPostCreate(AccountPK pk, String personsName) 56 throws CreateException , DuplicateKeyException , EJBException , 57 RemoteException 58 { 59 log.debug("entry ejbPostCreate, pk=" + pk); 60 } 61 62 public void ejbLoad() 63 throws EJBException , RemoteException 64 { 65 log.debug("ejbLoad () called"); 66 67 } 68 69 public void ejbStore() 70 throws EJBException , RemoteException 71 { 72 log.debug("ejbStore () called"); 73 74 } 75 76 public void ejbRemove() 77 throws EJBException , RemoteException 78 { 79 log.debug("ejbRemove () called"); 80 81 } 82 83 public void ejbActivate() 84 throws EJBException , RemoteException 85 { 86 log.debug("ejbActivate () called"); 87 } 88 89 public void ejbPassivate() 90 throws EJBException , RemoteException 91 { 92 log.debug("ejbPassivate () called"); 93 } 94 95 public void setEntityContext(EntityContext ctx) 96 throws EJBException , RemoteException 97 { 98 log.debug("setEntityContext called"); 99 this.ctx = ctx; 100 } 101 102 public void unsetEntityContext() 103 throws EJBException , RemoteException 104 { 105 log.debug("unsetEntityContext () called"); 106 107 ctx = null; 108 } 109 110 public abstract void setPk(AccountPK pk); 111 public abstract AccountPK getPk(); 112 113 public abstract void setPersonsName(String personsName); 114 public abstract String getPersonsName(); 115 116 public abstract void setPersonsAge(int age); 117 public abstract int getPersonsAge(); 118 119 } 120 | Popular Tags |