1 3 package org.objectweb.clusterDemo; 4 5 import javax.ejb.CreateException ; 6 import javax.ejb.DuplicateKeyException ; 7 import javax.ejb.EntityBean ; 8 import javax.ejb.EntityContext ; 9 import javax.ejb.RemoveException ; 10 11 import org.objectweb.jonas.common.Log; 12 import org.objectweb.util.monolog.api.Logger; 13 import org.objectweb.util.monolog.api.BasicLevel; 14 15 18 public abstract class BankAccountECL implements EntityBean { 19 20 static private Logger logger = null; 21 22 EntityContext ejbContext; 23 24 28 37 public void setEntityContext(EntityContext ctx) { 38 if (logger == null) { 39 logger = Log.getLogger("org.objectweb.jonas_tests"); 40 } 41 logger.log(BasicLevel.DEBUG, ""); 42 ejbContext = ctx; 43 } 44 45 54 public void unsetEntityContext() { 55 logger.log(BasicLevel.DEBUG, ""); 56 ejbContext = null; 57 } 58 59 71 public void ejbRemove() throws RemoveException { 72 logger.log(BasicLevel.DEBUG, ""); 73 } 74 75 82 public void ejbLoad() { 83 logger.log(BasicLevel.DEBUG, ""); 84 } 85 86 93 public void ejbStore() { 94 logger.log(BasicLevel.DEBUG, ""); 95 } 96 97 101 public void ejbPostCreate(int b, String n) throws CreateException { 102 logger.log(BasicLevel.DEBUG, ""); 103 } 104 105 110 public java.lang.String ejbCreate(int b, String n) throws CreateException , DuplicateKeyException { 111 logger.log(BasicLevel.DEBUG, ""); 112 113 setBalance(b); 115 setName(n); 116 117 return null; 119 } 120 121 125 public void ejbPassivate() { 126 logger.log(BasicLevel.DEBUG, ""); 127 } 128 129 134 public void ejbActivate() { 135 logger.log(BasicLevel.DEBUG, ""); 136 } 137 138 142 145 public void putMoney(int value) { 146 logger.log(BasicLevel.DEBUG, ""); 147 setBalance(getBalance() + value); 148 } 149 150 153 public void getMoney(int value) { 154 logger.log(BasicLevel.DEBUG, ""); 155 setBalance(getBalance() - value); 156 } 157 158 public abstract String getName(); 159 160 public abstract void setName(String name); 161 162 public abstract double getBalance(); 163 164 public abstract void setBalance(double balance); 165 166 } | Popular Tags |