1 25 26 package org.objectweb.jonas.jtests.beans.relation.oob; 27 28 import org.objectweb.util.monolog.api.Logger; 29 import org.objectweb.util.monolog.api.BasicLevel; 30 import org.objectweb.jonas.common.Log; 31 32 import javax.ejb.EntityContext ; 33 import javax.ejb.CreateException ; 34 import javax.ejb.DuplicateKeyException ; 35 import javax.ejb.RemoveException ; 36 37 40 public abstract class BEC2 implements javax.ejb.EntityBean { 41 public void m1(){ 42 } 43 44 public abstract String getId(); 48 49 public abstract void setId(String id); 50 51 55 static protected Logger logger = null; 56 EntityContext ejbContext; 57 58 64 public String ejbCreate(String id) throws CreateException , DuplicateKeyException { 65 logger.log(BasicLevel.DEBUG, ""); 66 67 setId(id); 69 70 return null; 72 } 73 74 84 public void setEntityContext(EntityContext ctx) { 85 if (logger == null) 86 logger = Log.getLogger(Log.JONAS_TESTS_PREFIX); 87 logger.log(BasicLevel.DEBUG, ""); 88 ejbContext = ctx; 89 } 90 91 102 public void unsetEntityContext() { 103 logger.log(BasicLevel.DEBUG, ""); 104 ejbContext = null; 105 } 106 107 public abstract ALocal getA(); 108 public abstract void setA(ALocal al); 109 110 public abstract ALocal getABis(); 111 public abstract void setABis(ALocal al); 112 113 public String retrieveA() { 114 ALocal lejbA = getA(); 115 if (lejbA==null) 116 return null; 117 else 118 return lejbA.getId(); 119 } 120 121 public String retrieveAInNewTx() { 122 return retrieveA(); 123 } 124 125 138 public void ejbRemove() throws RemoveException { 139 logger.log(BasicLevel.DEBUG, ""); 140 } 141 142 150 public void ejbLoad() { 151 logger.log(BasicLevel.DEBUG, ""); 152 } 153 154 162 public void ejbStore() { 163 logger.log(BasicLevel.DEBUG, ""); 164 } 165 166 171 public void ejbPostCreate(String id) throws CreateException { 172 logger.log(BasicLevel.DEBUG, "id=" + id); 173 } 174 175 179 public void ejbPassivate() { 180 logger.log(BasicLevel.DEBUG, ""); 181 } 182 183 188 public void ejbActivate() { 189 logger.log(BasicLevel.DEBUG, ""); 190 } 191 192 } 193 194 | Popular Tags |