1 22 package org.jboss.test.entity.ejb; 23 24 import javax.ejb.CreateException ; 25 import javax.ejb.EntityBean ; 26 import javax.ejb.EntityContext ; 27 import javax.ejb.RemoveException ; 28 29 import org.jboss.test.entity.interfaces.Pathological; 30 import org.jboss.test.entity.interfaces.PathologicalEntityHome; 31 import org.jboss.test.entity.interfaces.PathologicalEntity; 32 33 39 public class PathologicalEntityBean 40 implements EntityBean 41 { 42 private EntityContext entityContext; 43 44 private String name; 45 46 public String getName() 47 { 48 pathological(); 49 return name; 50 } 51 52 public String getSomething() 53 { 54 pathological(); 55 return "Something"; 56 } 57 58 public void setSomething(String value) 59 { 60 pathological(); 61 } 62 63 public String ejbCreate(String name) 64 throws CreateException 65 { 66 pathological(); 67 this.name = name; 68 return name; 69 } 70 71 public void ejbPostCreate(String name) 72 throws CreateException 73 { 74 } 75 76 public String ejbFindByPrimaryKey(String name) 77 { 78 pathological(); 79 return name; 80 } 81 82 public void ejbActivate() 83 { 84 pathological(); 85 } 86 87 public void ejbLoad() 88 { 89 pathological(); 90 } 91 92 public void ejbPassivate() 93 { 94 pathological(); 95 } 96 97 public void ejbRemove() 98 throws RemoveException 99 { 100 pathological(); 101 } 102 103 public void ejbStore() 104 { 105 pathological(); 106 } 107 108 public void setEntityContext(EntityContext context) 109 { 110 pathological(); 111 entityContext = context; 112 } 113 114 public void unsetEntityContext() 115 { 116 pathological(); 117 entityContext = null; 118 } 119 120 private void pathological() 121 { 122 if (Pathological.isPathological()) 123 throw new Error ("Handle this correctly please"); 124 } 125 } 126 | Popular Tags |