KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > test > cts > ejb > CtsCmp2Bean


1 package org.jboss.test.cts.ejb;
2
3 import javax.ejb.CreateException JavaDoc;
4 import javax.ejb.CreateException JavaDoc;
5 import javax.ejb.EntityBean JavaDoc;
6 import javax.ejb.EntityContext JavaDoc;
7
8 import org.jboss.logging.Logger;
9
10 /**
11  @author Scott.Stark@jboss.org
12  @version $Revision: 23153 $
13  */

14 public abstract class CtsCmp2Bean implements EntityBean JavaDoc
15 {
16    private static String JavaDoc VERSION = "CtsCmp2BeanV2";
17    private static Logger log = Logger.getLogger(CtsCmp2Bean.class);
18    private EntityContext JavaDoc ctx;
19
20    public String JavaDoc ejbCreate(String JavaDoc key, String JavaDoc data)
21       throws CreateException JavaDoc
22    {
23       log.debug("ejbCreate '" + key + "' "+ data+", version="+VERSION);
24       setKey(key);
25       setData(data);
26       return null;
27    }
28
29    public void ejbPostCreate(String JavaDoc key, String JavaDoc data)
30    {
31       log.debug("ejbPostCreate'" + key + "' "+ data);
32    }
33
34    // CMP field accessors -----------------------------------------------------
35
public abstract String JavaDoc getKey();
36    public abstract void setKey(String JavaDoc param);
37    public abstract String JavaDoc getData();
38    public abstract void setData(String JavaDoc param);
39    public abstract String JavaDoc getMoreData();
40    public abstract void setMoreData(String JavaDoc param);
41
42 // EJB callbacks
43
public void ejbLoad ()
44    {
45       log.debug("ejbLoad () called");
46
47    }
48
49    public void ejbStore ()
50    {
51       log.debug("ejbStore () called");
52    }
53
54    public void ejbRemove ()
55    {
56       log.debug("ejbRemove () called");
57    }
58
59    public void ejbActivate ()
60    {
61       log.debug("ejbActivate () called");
62    }
63
64    public void ejbPassivate ()
65    {
66       log.debug("ejbPassivate () called");
67    }
68
69    public void setEntityContext (EntityContext JavaDoc ctx)
70    {
71       log.debug("setEntityContext () called");
72       this.ctx = ctx;
73    }
74
75    public void unsetEntityContext ()
76    {
77       log.debug("unsetEntityContext () called");
78       ctx = null;
79    }
80 }
81
Popular Tags