KickJava   Java API By Example, From Geeks To Geeks.

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


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: PersonEC.java,v 1.2 2004/05/26 08:00:01 benoitf Exp $
23  * --------------------------------------------------------------------------
24  */

25
26 // PersonEC.java
27

28 package org.objectweb.jonas.jtests.beans.inherit;
29
30 import javax.ejb.CreateException JavaDoc;
31 import javax.ejb.EntityBean JavaDoc;
32 import javax.ejb.EntityContext JavaDoc;
33 import javax.ejb.RemoveException JavaDoc;
34
35 import org.objectweb.jonas.common.Log;
36 import org.objectweb.util.monolog.api.Logger;
37 import org.objectweb.util.monolog.api.BasicLevel;
38
39
40 public class PersonEC extends PersonImpl implements EntityBean JavaDoc {
41
42     static protected Logger logger = null;
43     protected EntityContext JavaDoc entityContext;
44
45     public IdPK ejbCreate(int val_id, String JavaDoc val_name) throws CreateException JavaDoc {
46
47     logger.log(BasicLevel.DEBUG,
48            "PersonEC.ejbCreate(int " + val_id + " ,String " + val_name + ")");
49     // what should be done in a container managed bean is only the following lines ...
50
id = val_id;
51     name = val_name;
52     age = 1;
53
54     return(null);
55     }
56     
57     public void ejbPostCreate(int val_id, String JavaDoc val_name) {
58     }
59
60     public void ejbActivate() {
61     }
62
63     public void ejbPassivate() {
64     }
65
66     public void ejbLoad() {
67     }
68
69     public void ejbStore() {
70     }
71   
72     // Test with no RemoveException exception
73
public void ejbRemove() {
74     }
75
76     public void setEntityContext(EntityContext JavaDoc ctx) {
77         if (logger == null) {
78         logger = Log.getLogger("org.objectweb.jonas_tests");
79     }
80     logger.log(BasicLevel.DEBUG, "");
81     entityContext = ctx;
82     }
83
84     public void unsetEntityContext() {
85     }
86
87 }
88
Popular Tags