KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas > jtests > beans > inherit > UserEC


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: UserEC.java,v 1.2 2005/03/11 12:37:03 joaninh Exp $
23  * --------------------------------------------------------------------------
24  */

25
26 // UserEC.java
27
package org.objectweb.jonas.jtests.beans.inherit;
28
29 import javax.ejb.CreateException JavaDoc;
30 import javax.ejb.EntityBean JavaDoc;
31 import javax.ejb.EntityContext JavaDoc;
32 import javax.ejb.RemoveException JavaDoc;
33
34 import org.objectweb.jonas.common.Log;
35 import org.objectweb.util.monolog.api.Logger;
36 import org.objectweb.util.monolog.api.BasicLevel;
37
38 public class UserEC extends UserImpl implements EntityBean JavaDoc {
39
40     static protected Logger logger = null;
41
42     protected EntityContext JavaDoc entityContext;
43
44     public IdPK ejbCreate(int val_id, String JavaDoc val_name) throws CreateException JavaDoc {
45
46         logger.log(BasicLevel.DEBUG, "UserEC.ejbCreate(int " + val_id + " ,String " + val_name + ")");
47
48         // what should be done in a container managed bean is only the following
49
// lines ...
50
id = val_id;
51         name = val_name;
52         age = 0;
53         password = "bidon";
54
55         return (null);
56     }
57
58     public void ejbPostCreate(int val_id, String JavaDoc val_name) {
59     }
60
61     public void ejbActivate() {
62     }
63
64     public void ejbPassivate() {
65     }
66
67     public void ejbLoad() {
68
69     }
70
71     public void ejbStore() {
72     }
73
74     public void ejbRemove() throws RemoveException JavaDoc {
75     }
76
77     public void setEntityContext(EntityContext JavaDoc ctx) {
78         if (logger == null) {
79             logger = Log.getLogger("org.objectweb.jonas_tests");
80         }
81         logger.log(BasicLevel.DEBUG, "");
82         entityContext = ctx;
83     }
84
85     public void unsetEntityContext() {
86     }
87
88     // This method is useful to test the overloaded methods in bean
89
public String JavaDoc getData() {
90         return "UserEC.getData";
91     }
92
93     // This method is useful to test the bug #301113
94
public int methBug301113(int p) {
95         return p;
96     }
97
98 }
99
Popular Tags