1 package org.objectweb.jonas.stests.appli; 3 4 import org.objectweb.jonas.common.Log; 5 import org.objectweb.util.monolog.api.Logger; 6 import org.objectweb.util.monolog.api.BasicLevel; 7 8 11 public abstract class DistrictEC2R implements javax.ejb.EntityBean { 12 13 static private Logger logger = null; 14 javax.ejb.EntityContext ejbContext; 15 16 17 public java.lang.String ejbCreate(int did, String wid, String name, int order) 18 throws javax.ejb.CreateException { 19 logger.log(BasicLevel.DEBUG, ""); 20 setDistrictId(did); 21 setNextOrder(order); 22 setDistrictName(name); 23 setWarehouseId(wid); 24 return null; 25 } 26 27 public void ejbPostCreate(int did, String wid, String name, int order) { 28 logger.log(BasicLevel.DEBUG, ""); 29 } 30 31 public abstract int getDistrictId(); 36 public abstract void setDistrictId(int id); 37 38 public abstract int getNextOrder(); 39 public abstract void setNextOrder(int o); 40 41 public abstract String getWarehouseId(); 42 public abstract void setWarehouseId(String w); 43 44 public abstract String getDistrictName(); 45 public abstract void setDistrictName(String w); 46 47 51 52 public void setEntityContext(javax.ejb.EntityContext ctx) { 53 if (logger == null) { 54 logger = Log.getLogger("org.objectweb.jonas_tests"); 55 } 56 logger.log(BasicLevel.DEBUG, ""); 57 ejbContext = ctx; 58 } 59 60 61 public void unsetEntityContext() { 62 logger.log(BasicLevel.DEBUG, ""); 63 ejbContext = null; 64 } 65 66 public void ejbRemove() throws javax.ejb.RemoveException { 67 logger.log(BasicLevel.DEBUG, ""); 68 } 69 70 71 public void ejbLoad() { 72 logger.log(BasicLevel.DEBUG, ""); 73 } 74 75 76 public void ejbStore() { 77 logger.log(BasicLevel.DEBUG, ""); 78 } 79 80 81 public void ejbPassivate() { 82 logger.log(BasicLevel.DEBUG, ""); 83 } 84 85 86 public void ejbActivate() { 87 logger.log(BasicLevel.DEBUG, ""); 88 } 89 90 public void setNextOrderId(int order) { 91 setNextOrder(order); 92 } 93 103 public int getNextOrderId(boolean increment) { 104 int temp = getNextOrder(); 105 if (increment) { 106 setNextOrder(temp+1); 107 108 } 109 logger.log(BasicLevel.DEBUG,"DistrictBean getNextOrderId returns :"+temp); 110 return temp; 111 } 112 113 } 114 115 116 117 | Popular Tags |