KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2   * JBoss, Home of Professional Open Source
3   * Copyright 2005, JBoss Inc., and individual contributors as indicated
4   * by the @authors tag. See the copyright.txt in the distribution for a
5   * full listing of individual contributors.
6   *
7   * This is free software; you can redistribute it and/or modify it
8   * under the terms of the GNU Lesser General Public License as
9   * published by the Free Software Foundation; either version 2.1 of
10   * the License, or (at your option) any later version.
11   *
12   * This software is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15   * Lesser General Public License for more details.
16   *
17   * You should have received a copy of the GNU Lesser General Public
18   * License along with this software; if not, write to the Free
19   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21   */

22 package org.jboss.test.cts.ejb;
23
24 import java.rmi.RemoteException JavaDoc;
25 import javax.ejb.EntityBean JavaDoc;
26 import javax.ejb.EntityContext JavaDoc;
27 import javax.ejb.CreateException JavaDoc;
28 import javax.ejb.DuplicateKeyException JavaDoc;
29 import javax.ejb.EJBException JavaDoc;
30
31
32 import org.jboss.test.cts.keys.AccountPK;
33 import org.jboss.logging.Logger;
34
35 /**
36  * A simple cmp2 entity bean implementation
37  * @author Scott.Stark@jboss.org
38  * @version $Revision: 37406 $
39  */

40 public abstract class CtsCmpBean
41    implements EntityBean JavaDoc
42 {
43    static Logger log = Logger.getLogger(CtsCmpBean.class);
44    private EntityContext JavaDoc ctx = null;
45
46    public AccountPK ejbCreate(AccountPK pk, String JavaDoc personsName)
47       throws CreateException JavaDoc, DuplicateKeyException JavaDoc
48    {
49       log.debug("entry ejbCreate, pk=" + pk);
50       setPk(pk);
51       setPersonsName(personsName);
52       return null;
53    }
54
55    public void ejbPostCreate(AccountPK pk, String JavaDoc personsName)
56       throws CreateException JavaDoc, DuplicateKeyException JavaDoc, EJBException JavaDoc,
57       RemoteException JavaDoc
58    {
59       log.debug("entry ejbPostCreate, pk=" + pk);
60    }
61
62    public void ejbLoad()
63       throws EJBException JavaDoc, RemoteException JavaDoc
64    {
65       log.debug("ejbLoad () called");
66
67    }
68
69    public void ejbStore()
70       throws EJBException JavaDoc, RemoteException JavaDoc
71    {
72       log.debug("ejbStore () called");
73
74    }
75
76    public void ejbRemove()
77       throws EJBException JavaDoc, RemoteException JavaDoc
78    {
79       log.debug("ejbRemove () called");
80
81    }
82
83    public void ejbActivate()
84       throws EJBException JavaDoc, RemoteException JavaDoc
85    {
86       log.debug("ejbActivate () called");
87    }
88
89    public void ejbPassivate()
90       throws EJBException JavaDoc, RemoteException JavaDoc
91    {
92       log.debug("ejbPassivate () called");
93    }
94
95    public void setEntityContext(EntityContext JavaDoc ctx)
96       throws EJBException JavaDoc, RemoteException JavaDoc
97    {
98       log.debug("setEntityContext called");
99       this.ctx = ctx;
100    }
101
102    public void unsetEntityContext()
103       throws EJBException JavaDoc, RemoteException JavaDoc
104    {
105       log.debug("unsetEntityContext () called");
106
107       ctx = null;
108    }
109
110    public abstract void setPk(AccountPK pk);
111    public abstract AccountPK getPk();
112
113    public abstract void setPersonsName(String JavaDoc personsName);
114    public abstract String JavaDoc getPersonsName();
115
116    public abstract void setPersonsAge(int age);
117    public abstract int getPersonsAge();
118
119 }
120
Popular Tags