1 25 26 28 package org.objectweb.jonas.jtests.beans.relatives; 29 30 import java.util.Date ; 31 import java.util.Set ; 32 33 import javax.ejb.CreateException ; 34 import javax.ejb.DuplicateKeyException ; 35 import javax.ejb.EntityBean ; 36 import javax.ejb.EntityContext ; 37 import javax.ejb.RemoveException ; 38 39 import org.objectweb.jonas.common.Log; 40 import org.objectweb.util.monolog.api.BasicLevel; 41 import org.objectweb.util.monolog.api.Logger; 42 43 47 public abstract class RelativeEC2 implements EntityBean { 48 49 static protected Logger logger = null; 50 EntityContext ejbContext; 51 52 public abstract String getFullName(); 56 57 public abstract void setFullName(String name); 58 59 public abstract int getLuckyNumber(); 60 61 public abstract void setLuckyNumber(int age); 62 63 public abstract Date getBirthdate(); 64 65 public abstract void setBirthdate(Date birthdate); 66 67 public abstract RelativeLocal getSpouse(); 68 69 public abstract void setSpouse(RelativeLocal spouse); 70 71 public abstract Set getSibblings(); 72 73 public abstract void setSibblings(Set sibblings); 74 75 public abstract Set getVisitedRelatives(); 76 77 public abstract void setVisitedRelatives(Set sibblings); 78 79 public abstract boolean getIsMale(); 80 81 public abstract void setIsMale(boolean isMale); 82 83 public abstract double getAverageAnnualVisits(); 84 85 public abstract void setAverageAnnualVisits(double averageAnnualVisits); 86 87 91 94 public void setEntityContext(EntityContext ctx) { 95 if (logger == null) 96 logger = Log.getLogger(Log.JONAS_TESTS_PREFIX); 97 logger.log(BasicLevel.DEBUG, ""); 98 ejbContext = ctx; 99 } 100 101 104 public void unsetEntityContext() { 105 logger.log(BasicLevel.DEBUG, ""); 106 ejbContext = null; 107 } 108 109 113 public void ejbRemove() throws RemoveException { 114 logger.log(BasicLevel.DEBUG, ""); 115 } 116 117 121 public void ejbLoad() { 122 logger.log(BasicLevel.DEBUG, ""); 123 } 124 125 129 public void ejbStore() { 130 logger.log(BasicLevel.DEBUG, ""); 131 } 132 133 136 public String ejbCreate(String fullName, Date birthdate, int luckyNumber) throws CreateException , DuplicateKeyException { 137 logger.log(BasicLevel.DEBUG, ""); 138 139 setFullName(fullName); 140 setBirthdate(birthdate); 141 setLuckyNumber(luckyNumber); 142 143 return null; 145 } 146 147 152 public void ejbPostCreate(String fullName, Date birthdate, int luckyNumber) throws CreateException { 153 logger.log(BasicLevel.DEBUG, ""); 154 } 155 156 157 169 public void ejbPassivate() { 170 logger.log(BasicLevel.DEBUG, ""); 171 } 172 173 182 public void ejbActivate() { 183 logger.log(BasicLevel.DEBUG, ""); 184 } 185 186 } 187 | Popular Tags |