KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas > jtests > beans > fbasic > SimpleEC2


1 /*
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 1999 Bull S.A.
4  * Contact: jonas-team@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  *
21  * --------------------------------------------------------------------------
22  * $Id: SimpleEC2.java,v 1.1 2003/12/05 14:16:52 legrasi Exp $
23  * --------------------------------------------------------------------------
24  */

25
26 package org.objectweb.jonas.jtests.beans.fbasic;
27
28 import javax.ejb.EJBException JavaDoc;
29 import javax.ejb.EntityBean JavaDoc;
30 import javax.ejb.EntityContext JavaDoc;
31 import javax.ejb.RemoveException JavaDoc;
32 import javax.ejb.CreateException JavaDoc;
33 import javax.ejb.EntityContext JavaDoc;
34
35
36
37
38 /**
39  * This is an entity bean with "container managed persistence version 2.x".
40  * The state of an instance is stored into a relational database.
41  * The following table should exist :
42  * ebasicSimpleEC2
43  * c_testname varchar(30) primarey key
44  * c_info integer
45  * c_numtest integer
46  * @author Philippe Coq, Philippe Durieux, Helene Joanin
47  */

48
49 public abstract class SimpleEC2 implements EntityBean JavaDoc {
50
51     // static protected Logger logger = null;
52

53     protected EntityContext JavaDoc entityContext;
54
55
56     // Get and Set accessor methods of the bean's abstract schema
57
public abstract int getInfo();
58     public abstract void setInfo(int info);
59
60     public abstract int getNumTest();
61     public abstract void setNumTest(int numtest);
62
63     public abstract String JavaDoc getTestName();
64     public abstract void setTestName(String JavaDoc testname);
65
66
67     public void ejbActivate() {
68         //logger.log(BasicLevel.DEBUG, "");
69
}
70
71     public void ejbPassivate() {
72         //logger.log(BasicLevel.DEBUG, "");
73
}
74
75     public void ejbLoad() {
76         //logger.log(BasicLevel.DEBUG, "");
77
}
78
79     public void ejbStore() {
80         //logger.log(BasicLevel.DEBUG, "");
81
}
82   
83     public void ejbRemove() throws RemoveException JavaDoc {
84         //logger.log(BasicLevel.DEBUG, "");
85
}
86
87     public void setEntityContext(EntityContext JavaDoc ctx) {
88         //if (logger == null)
89
//logger = Log.getLogger(Log.JONAS_TESTS_PREFIX);
90
//logger.log(BasicLevel.DEBUG, "");
91
entityContext = ctx;
92     
93     }
94
95     public void unsetEntityContext() {
96         //logger.log(BasicLevel.DEBUG, "");
97
}
98
99     public String JavaDoc ejbCreate(String JavaDoc name, int info, int num) throws CreateException JavaDoc {
100         //logger.log(BasicLevel.DEBUG, "create"+info+","+name+","+num);
101
setInfo(info);
102     setNumTest(num);
103     setTestName(name);
104     return(null);
105     }
106
107     public void ejbPostCreate(String JavaDoc name, int info, int num){
108         //logger.log(BasicLevel.DEBUG, "");
109
}
110
111 }
112
Popular Tags