KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas > jtests > beans > secured > BaseEC2


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: BaseEC2.java,v 1.3 2004/03/19 11:57:17 benoitf Exp $
23  * --------------------------------------------------------------------------
24  */

25
26 package org.objectweb.jonas.jtests.beans.secured;
27
28 import javax.ejb.CreateException JavaDoc;
29 import javax.ejb.EJBContext 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
37 /**
38  * This is an entity bean with "container managed persistence 2".
39  * The state of an instance is stored into a relational database.
40  * @author Helene Joanin (jonas team)
41  */

42 public abstract class BaseEC2 extends BaseCommon implements EntityBean JavaDoc {
43
44     protected EntityContext JavaDoc entityContext;
45     
46     // ------------------------------------------------------------------
47
// Get and Set accessor methods of the bean's abstract schema
48
// ------------------------------------------------------------------
49
public abstract String JavaDoc getInfo();
50     public abstract void setInfo(String JavaDoc n);
51     public abstract String JavaDoc getName();
52     public abstract void setName(String JavaDoc n);
53
54     public EJBContext JavaDoc getEJBContext() {
55         return entityContext;
56     }
57
58     public void ejbActivate() {
59         logger.log(BasicLevel.DEBUG, "");
60     }
61
62     public void ejbPassivate() {
63         logger.log(BasicLevel.DEBUG, "");
64     }
65
66     public void ejbLoad() {
67         logger.log(BasicLevel.DEBUG, "");
68     }
69
70     public void ejbStore() {
71     logger.log(BasicLevel.DEBUG, "");
72     }
73   
74     public void ejbRemove() throws RemoveException JavaDoc {
75         logger.log(BasicLevel.DEBUG, "");
76     }
77
78     public void setEntityContext(EntityContext JavaDoc ctx) {
79         if( logger == null)
80             logger = Log.getLogger(Log.JONAS_TESTS_PREFIX);
81         logger.log(BasicLevel.DEBUG, "");
82     entityContext = ctx;
83     
84     }
85
86     public void unsetEntityContext() {
87     logger.log(BasicLevel.DEBUG, "");
88     }
89
90     public String JavaDoc ejbCreate(String JavaDoc name, String JavaDoc info) throws CreateException JavaDoc {
91     logger.log(BasicLevel.DEBUG,"");
92     setInfo(info);
93     setName(name);
94     return(null);
95     }
96
97     public void ejbPostCreate(String JavaDoc name, String JavaDoc info){
98     logger.log(BasicLevel.DEBUG, "");
99     }
100
101 }
102
Popular Tags