1 25 26 31 32 package org.objectweb.jonas.jtests.beans.ebasic; 33 34 import javax.ejb.CreateException ; 35 import javax.ejb.DuplicateKeyException ; 36 import javax.ejb.EntityBean ; 37 import javax.ejb.EntityContext ; 38 import javax.ejb.RemoveException ; 39 40 import org.objectweb.jonas.common.Log; 41 import org.objectweb.util.monolog.api.BasicLevel; 42 import org.objectweb.util.monolog.api.Logger; 43 44 47 public abstract class PersonEC2 implements EntityBean { 48 49 static protected Logger logger = null; 50 EntityContext ejbContext; 51 52 public abstract Integer getNumber(); 56 public abstract void setNumber(Integer num); 57 58 public abstract String getName(); 59 public abstract void setName(String name); 60 61 65 75 public void setEntityContext(EntityContext ctx) { 76 if (logger == null) { 77 logger = Log.getLogger(Log.JONAS_TESTS_PREFIX); 78 } 79 logger.log(BasicLevel.DEBUG, ""); 80 ejbContext = ctx; 81 } 82 83 94 public void unsetEntityContext() { 95 logger.log(BasicLevel.DEBUG, ""); 96 ejbContext = null; 97 } 98 99 112 public void ejbRemove() throws RemoveException { 113 logger.log(BasicLevel.DEBUG, ""); 114 } 115 116 124 public void ejbLoad() { 125 logger.log(BasicLevel.DEBUG, ""); 126 } 127 128 136 public void ejbStore() { 137 logger.log(BasicLevel.DEBUG, ""); 138 } 139 140 146 public java.lang.Object ejbCreate(int i, String s) throws CreateException , DuplicateKeyException { 147 logger.log(BasicLevel.DEBUG, ""); 148 149 setNumber(new Integer (i)); 151 setName(new String (s)); 152 153 return null; 155 } 156 157 162 public void ejbPostCreate(int i, String s) throws CreateException { 163 logger.log(BasicLevel.DEBUG, ""); 164 } 165 166 170 public void ejbPassivate() { 171 logger.log(BasicLevel.DEBUG, ""); 172 } 173 174 179 public void ejbActivate() { 180 logger.log(BasicLevel.DEBUG, ""); 181 } 182 183 187 190 public int getNumberPrimitive() { 191 logger.log(BasicLevel.DEBUG, ""); 192 return getNumber().intValue(); 193 } 194 195 } 196 | Popular Tags |