KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas > jtests > beans > ebasic > pkautoObjectEC2


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  * --------------------------------------------------------------------------
23  */

24
25 package org.objectweb.jonas.jtests.beans.ebasic;
26
27 import org.objectweb.jonas.common.Log;
28 import org.objectweb.util.monolog.api.Logger;
29 import org.objectweb.util.monolog.api.BasicLevel;
30
31 /**
32  * This is an entity bean with "container managed persistence version 2".
33  * This bean is used to test an entity with auto generated primary key
34  * @author Jerome Camilleri
35  */

36 public abstract class pkautoObjectEC2 implements javax.ejb.EntityBean JavaDoc {
37
38     static protected Logger logger = null;
39     javax.ejb.EntityContext JavaDoc ejbContext;
40
41  
42     public java.lang.Object JavaDoc ejbCreate(int f1, int f2) throws javax.ejb.CreateException JavaDoc {
43         logger.log(BasicLevel.DEBUG, "");
44
45         // Init here the bean fields
46
setField1(f1);
47         setField2(f2);
48         return null;
49     }
50
51     public void ejbPostCreate(int f1, int f2) {
52         logger.log(BasicLevel.DEBUG, "");
53     }
54
55     // ------------------------------------------------------------------
56
// Abstract Accessor methods for Persistent fields
57
// ------------------------------------------------------------------
58
public abstract int getField1();
59     public abstract void setField1(int f1);
60
61     public abstract int getField2();
62     public abstract void setField2(int f2);
63
64     // ------------------------------------------------------------------
65
// Standard call back methods
66
// ------------------------------------------------------------------
67

68     public void setEntityContext(javax.ejb.EntityContext JavaDoc ctx) {
69         if (logger == null) {
70             logger = Log.getLogger("org.objectweb.jonas_tests");
71         }
72         logger.log(BasicLevel.DEBUG, "");
73         ejbContext = ctx;
74     }
75
76     public void unsetEntityContext() {
77         logger.log(BasicLevel.DEBUG, "");
78         ejbContext = null;
79     }
80
81     public void ejbRemove() throws javax.ejb.RemoveException JavaDoc {
82         logger.log(BasicLevel.DEBUG, "");
83     }
84  
85     public void ejbLoad() {
86         logger.log(BasicLevel.DEBUG, "");
87     }
88
89     public void ejbStore() {
90         logger.log(BasicLevel.DEBUG, "");
91     }
92         
93     public void ejbPassivate() {
94         logger.log(BasicLevel.DEBUG, "");
95     }
96
97     public void ejbActivate() {
98         logger.log(BasicLevel.DEBUG, "");
99     }
100
101 }
102
103
104
105
Popular Tags