1 package indyjug.jboss.ejb;
2
3 import javax.ejb.CreateException;
4 import javax.ejb.EntityBean;
5 import javax.ejb.EntityContext;
6 import javax.ejb.RemoveException;
7
8 public abstract class StockBean implements EntityBean
9 {
10 private EntityContext ctx;
11
12 public String ejbCreate(String exchange, String symbol, String name,
13 double price) throws CreateException
14 {
15 setExchange(exchange);
16 setSymbol(symbol);
17 setName(name);
18 setPrice(new Double(price));
19
20 return null;
21 }
22
23 public void ejbPostCreate(String exchange, String symbol, String name,
24 double price) throws CreateException
25 {
26 }
27
28 public abstract String getExchange();
29
30 public abstract void setExchange(String exchange);
31
32 public abstract String getSymbol();
33
34 public abstract void setSymbol(String symbol);
35
36 public abstract String getName();
37
38 public abstract void setName(String name);
39
40 public abstract Double getPrice();
41
42 public abstract void setPrice(Double price);
43
44 public void ejbLoad()
45 {
46 }
47
48 public void ejbStore()
49 {
50 }
51
52 public void ejbActivate()
53 {
54 }
55
56 public void ejbPassivate()
57 {
58 }
59
60 public void ejbRemove() throws RemoveException
61 {
62 }
63
64 public void setEntityContext(EntityContext ctx)
65 {
66 this.ctx = ctx;
67 }
68
69 public void unsetEntityContext()
70 {
71 this.ctx = null;
72 }
73}
74