1 25 26 28 package org.objectweb.jonas.stests.manyops; 29 30 import javax.ejb.CreateException ; 31 import javax.ejb.DuplicateKeyException ; 32 import javax.ejb.EntityBean ; 33 import javax.ejb.EntityContext ; 34 import javax.ejb.RemoveException ; 35 36 import org.objectweb.jonas.common.Log; 37 import org.objectweb.util.monolog.api.BasicLevel; 38 import org.objectweb.util.monolog.api.Logger; 39 40 41 45 public abstract class ProductEC2 implements EntityBean { 46 47 static protected Logger logger = null; 48 EntityContext ejbContext; 49 50 public abstract String getName(); 54 public abstract void setName(String n); 55 public abstract int getNumber(); 56 public abstract void setNumber(int n); 57 public abstract int getPrice(); 58 public abstract void setPrice(int n); 59 60 64 74 public void setEntityContext(EntityContext ctx) { 75 if (logger == null) { 76 logger = Log.getLogger(Log.JONAS_TESTS_PREFIX); 77 } 78 logger.log(BasicLevel.DEBUG, ""); 79 ejbContext = ctx; 80 } 81 82 93 public void unsetEntityContext() { 94 logger.log(BasicLevel.DEBUG, ""); 95 ejbContext = null; 96 } 97 98 111 public void ejbRemove() throws RemoveException { 112 logger.log(BasicLevel.DEBUG, ""); 113 } 114 115 123 public void ejbLoad() { 124 logger.log(BasicLevel.DEBUG, ""); 125 } 126 127 135 public void ejbStore() { 136 logger.log(BasicLevel.DEBUG, ""); 137 } 138 139 144 public void ejbPostCreate(String n, int nb, int p) throws CreateException { 145 logger.log(BasicLevel.DEBUG, ""); 146 } 147 148 154 public java.lang.String ejbCreate(String n, int nb, int p) throws CreateException , DuplicateKeyException { 155 logger.log(BasicLevel.DEBUG, ""); 156 157 setName(n); 159 setNumber(nb); 160 setPrice(p); 161 162 return null; 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 } 188 | Popular Tags |