1 package org.objectweb.jonas.jtests.beans.cluster; 2 3 import javax.ejb.CreateException ; 4 import javax.ejb.DuplicateKeyException ; 5 import javax.ejb.EntityBean ; 6 import javax.ejb.EntityContext ; 7 import javax.ejb.RemoveException ; 8 9 import org.objectweb.jonas.common.Log; 10 import org.objectweb.util.monolog.api.BasicLevel; 11 import org.objectweb.util.monolog.api.Logger; 12 13 public class IdentityEC implements EntityBean { 14 15 static private Logger logger = null; 16 EntityContext ejbContext; 17 18 public String name; 23 public int number; 24 25 29 39 public void setEntityContext(EntityContext ctx) { 40 if (logger == null) { 41 logger = Log.getLogger(Log.JONAS_TESTS_PREFIX); 42 } 43 logger.log(BasicLevel.DEBUG, ""); 44 ejbContext = ctx; 45 } 46 47 57 public void unsetEntityContext() { 58 logger.log(BasicLevel.DEBUG, ""); 59 ejbContext = null; 60 } 61 62 75 public void ejbRemove() throws RemoveException { 76 logger.log(BasicLevel.DEBUG, "="+number); 77 } 78 79 87 public void ejbLoad() { 88 logger.log(BasicLevel.DEBUG, "="+number); 89 } 90 91 99 public void ejbStore() { 100 logger.log(BasicLevel.DEBUG, "="+number); 101 } 102 103 109 public String ejbCreate(String s, int i) throws CreateException , DuplicateKeyException { 110 111 name = s; 113 number = i; 114 logger.log(BasicLevel.DEBUG, "="+number); 115 116 return null; 118 } 119 120 125 public void ejbPostCreate(String s, int i) throws CreateException { 126 logger.log(BasicLevel.DEBUG, "="+number); 127 } 128 129 133 public void ejbPassivate() { 134 logger.log(BasicLevel.DEBUG, "="+number); 135 } 136 137 142 public void ejbActivate() { 143 logger.log(BasicLevel.DEBUG, "="+number); 144 } 145 146 150 153 public String getName() { 154 logger.log(BasicLevel.DEBUG, "="+number); 155 return name; 156 } 157 158 161 public int getNumber() { 162 logger.log(BasicLevel.DEBUG, "="+number); 163 return number; 164 } 165 166 169 public void setNumber(int val) { 170 number = val; 171 logger.log(BasicLevel.DEBUG, "="+number); 172 } 173 174 } 175 | Popular Tags |