001: /*
002: * JOnAS: Java(TM) Open Application Server
003: * Copyright (C) 1999 Bull S.A.
004: * Contact: jonas-team@objectweb.org
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or any later version.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public
017: * License along with this library; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
019: * USA
020: *
021: * --------------------------------------------------------------------------
022: * $Id: UserEC.java 6408 2005-03-11 12:37:03Z joaninh $
023: * --------------------------------------------------------------------------
024: */
025:
026: // UserEC.java
027: package org.objectweb.jonas.jtests.beans.inherit;
028:
029: import javax.ejb.CreateException;
030: import javax.ejb.EntityBean;
031: import javax.ejb.EntityContext;
032: import javax.ejb.RemoveException;
033:
034: import org.objectweb.jonas.common.Log;
035: import org.objectweb.util.monolog.api.Logger;
036: import org.objectweb.util.monolog.api.BasicLevel;
037:
038: public class UserEC extends UserImpl implements EntityBean {
039:
040: static protected Logger logger = null;
041:
042: protected EntityContext entityContext;
043:
044: public IdPK ejbCreate(int val_id, String val_name)
045: throws CreateException {
046:
047: logger.log(BasicLevel.DEBUG, "UserEC.ejbCreate(int " + val_id
048: + " ,String " + val_name + ")");
049:
050: // what should be done in a container managed bean is only the following
051: // lines ...
052: id = val_id;
053: name = val_name;
054: age = 0;
055: password = "bidon";
056:
057: return (null);
058: }
059:
060: public void ejbPostCreate(int val_id, String val_name) {
061: }
062:
063: public void ejbActivate() {
064: }
065:
066: public void ejbPassivate() {
067: }
068:
069: public void ejbLoad() {
070:
071: }
072:
073: public void ejbStore() {
074: }
075:
076: public void ejbRemove() throws RemoveException {
077: }
078:
079: public void setEntityContext(EntityContext ctx) {
080: if (logger == null) {
081: logger = Log.getLogger("org.objectweb.jonas_tests");
082: }
083: logger.log(BasicLevel.DEBUG, "");
084: entityContext = ctx;
085: }
086:
087: public void unsetEntityContext() {
088: }
089:
090: // This method is useful to test the overloaded methods in bean
091: public String getData() {
092: return "UserEC.getData";
093: }
094:
095: // This method is useful to test the bug #301113
096: public int methBug301113(int p) {
097: return p;
098: }
099:
100: }
|