KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas > jtests > beans > relation > cascade > PhoneBean


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: PhoneBean.java,v 1.3 2004/07/01 11:53:33 durieuxp Exp $
23  * --------------------------------------------------------------------------
24  */

25
26 package org.objectweb.jonas.jtests.beans.relation.cascade;
27
28 import java.rmi.RemoteException JavaDoc;
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.BasicLevel;
36 import org.objectweb.util.monolog.api.Logger;
37
38 /**
39  * Implementation for bean Phone
40  * @author Ph Durieux
41  */

42 public abstract class PhoneBean implements EntityBean JavaDoc {
43
44     static protected Logger logger = null;
45     protected EntityContext JavaDoc ejbContext = null;
46
47     public Object JavaDoc ejbCreate(String JavaDoc number, byte type, String JavaDoc name) throws CreateException JavaDoc {
48         logger.log(BasicLevel.DEBUG, "");
49         setNumber(number);
50         setType(type);
51         setName(name);
52         return null;
53     }
54
55     public void ejbPostCreate(String JavaDoc number, byte type, String JavaDoc name) {
56         logger.log(BasicLevel.DEBUG, "");
57     }
58
59     // persistent fields
60
public abstract Integer JavaDoc getId();
61     public abstract void setId(Integer JavaDoc id);
62     public abstract String JavaDoc getNumber();
63     public abstract void setNumber(String JavaDoc number);
64     public abstract byte getType();
65     public abstract void setType(byte type);
66     public abstract String JavaDoc getName();
67     public abstract void setName(String JavaDoc name);
68
69     // standard call back methods
70
public void setEntityContext(EntityContext JavaDoc ec) {
71         if (logger == null)
72             logger = Log.getLogger(Log.JONAS_TESTS_PREFIX);
73         logger.log(BasicLevel.DEBUG, "");
74         ejbContext = ec;
75     }
76
77     public void unsetEntityContext() {
78         logger.log(BasicLevel.DEBUG, "");
79         ejbContext = null;
80     }
81
82     public void ejbLoad() {
83         logger.log(BasicLevel.DEBUG, "");
84     }
85
86     public void ejbStore() {
87         logger.log(BasicLevel.DEBUG, "");
88     }
89
90     public void ejbActivate() {
91         logger.log(BasicLevel.DEBUG, "");
92     }
93
94     public void ejbPassivate() {
95         logger.log(BasicLevel.DEBUG, "");
96     }
97
98     public void ejbRemove() throws javax.ejb.RemoveException JavaDoc {
99         logger.log(BasicLevel.DEBUG, "");
100     }
101 }
102
Popular Tags