1 25 26 package org.objectweb.jonas.jtests.beans.relation.cascade; 27 28 import java.rmi.RemoteException ; 29 import javax.ejb.CreateException ; 30 import javax.ejb.EntityContext ; 31 import javax.ejb.EntityBean ; 32 33 import org.objectweb.jonas.common.Log; 34 import org.objectweb.util.monolog.api.BasicLevel; 35 import org.objectweb.util.monolog.api.Logger; 36 37 41 public abstract class AddressBean implements EntityBean { 42 43 static protected Logger logger = null; 44 protected EntityContext ejbContext = null; 45 46 public Integer ejbCreate(String street, String city, String state, String zip) throws CreateException { 47 logger.log(BasicLevel.DEBUG, ""); 48 setStreet(street); 49 setCity(city); 50 setState(state); 51 setZip(zip); 52 return null; 53 } 54 55 public void ejbPostCreate(String street, String city, String state, String zip) { 56 logger.log(BasicLevel.DEBUG, ""); 57 } 58 59 public Integer ejbCreate(AddressDO addr, CustomerL customer) throws CreateException { 60 setStreet(addr.getStreet()); 61 setCity(addr.getCity()); 62 setState(addr.getState()); 63 setZip(addr.getZip()); 64 return null; 65 } 66 67 public void ejbPostCreate(AddressDO addr, CustomerL customer) throws CreateException { 68 } 73 74 public Integer getCustomerId() throws RemoteException { 75 logger.log(BasicLevel.DEBUG, ""); 76 CustomerL c = getCustomer(); 77 Integer ret = null; 78 if (c != null) { 79 ret = c.getId(); 80 } 81 return ret; 82 } 83 84 85 public abstract CustomerL getCustomer(); 87 public abstract void setCustomer(CustomerL cust); 88 89 public abstract Integer getId(); 91 public abstract void setId(Integer id); 92 public abstract String getStreet(); 93 public abstract void setStreet(String street); 94 public abstract String getCity(); 95 public abstract void setCity(String city); 96 public abstract String getState(); 97 public abstract void setState(String state); 98 public abstract String getZip(); 99 public abstract void setZip(String zip); 100 101 103 public void setEntityContext(EntityContext ec) { 104 if (logger == null) 105 logger = Log.getLogger(Log.JONAS_TESTS_PREFIX); 106 logger.log(BasicLevel.DEBUG, ""); 107 ejbContext = ec; 108 } 109 110 public void unsetEntityContext() { 111 logger.log(BasicLevel.DEBUG, ""); 112 ejbContext = null; 113 } 114 115 public void ejbLoad() { 116 logger.log(BasicLevel.DEBUG, ""); 117 } 118 119 public void ejbStore() { 120 logger.log(BasicLevel.DEBUG, ""); 121 } 122 123 public void ejbActivate() { 124 logger.log(BasicLevel.DEBUG, ""); 125 } 126 127 public void ejbPassivate() { 128 logger.log(BasicLevel.DEBUG, ""); 129 } 130 131 public void ejbRemove() throws javax.ejb.RemoveException { 132 logger.log(BasicLevel.DEBUG, ""); 133 } 134 } 135 | Popular Tags |