01: /*
02: * JOnAS: Java(TM) Open Application Server
03: * Copyright (C) 1999 Bull S.A.
04: * Contact: jonas-team@objectweb.org
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * 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 4810 2004-05-26 08:00:01Z benoitf $
23: * --------------------------------------------------------------------------
24: */
25:
26: // PersonEC.java
27: package org.objectweb.jonas.jtests.beans.inherit;
28:
29: import javax.ejb.CreateException;
30: import javax.ejb.EntityBean;
31: import javax.ejb.EntityContext;
32: import javax.ejb.RemoveException;
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 PersonEC extends PersonImpl implements EntityBean {
39:
40: static protected Logger logger = null;
41: protected EntityContext entityContext;
42:
43: public IdPK ejbCreate(int val_id, String val_name)
44: throws CreateException {
45:
46: logger.log(BasicLevel.DEBUG, "PersonEC.ejbCreate(int " + val_id
47: + " ,String " + val_name + ")");
48: // what should be done in a container managed bean is only the following lines ...
49: id = val_id;
50: name = val_name;
51: age = 1;
52:
53: return (null);
54: }
55:
56: public void ejbPostCreate(int val_id, String val_name) {
57: }
58:
59: public void ejbActivate() {
60: }
61:
62: public void ejbPassivate() {
63: }
64:
65: public void ejbLoad() {
66: }
67:
68: public void ejbStore() {
69: }
70:
71: // Test with no RemoveException exception
72: public void ejbRemove() {
73: }
74:
75: public void setEntityContext(EntityContext ctx) {
76: if (logger == null) {
77: logger = Log.getLogger("org.objectweb.jonas_tests");
78: }
79: logger.log(BasicLevel.DEBUG, "");
80: entityContext = ctx;
81: }
82:
83: public void unsetEntityContext() {
84: }
85:
86: }
|