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: PhoneBean.java 5033 2004-07-01 11:53:33Z durieuxp $
023: * --------------------------------------------------------------------------
024: */
025:
026: package org.objectweb.jonas.jtests.beans.relation.cascade;
027:
028: import java.rmi.RemoteException;
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.BasicLevel;
036: import org.objectweb.util.monolog.api.Logger;
037:
038: /**
039: * Implementation for bean Phone
040: * @author Ph Durieux
041: */
042: public abstract class PhoneBean implements EntityBean {
043:
044: static protected Logger logger = null;
045: protected EntityContext ejbContext = null;
046:
047: public Object ejbCreate(String number, byte type, String name)
048: throws CreateException {
049: logger.log(BasicLevel.DEBUG, "");
050: setNumber(number);
051: setType(type);
052: setName(name);
053: return null;
054: }
055:
056: public void ejbPostCreate(String number, byte type, String name) {
057: logger.log(BasicLevel.DEBUG, "");
058: }
059:
060: // persistent fields
061: public abstract Integer getId();
062:
063: public abstract void setId(Integer id);
064:
065: public abstract String getNumber();
066:
067: public abstract void setNumber(String number);
068:
069: public abstract byte getType();
070:
071: public abstract void setType(byte type);
072:
073: public abstract String getName();
074:
075: public abstract void setName(String name);
076:
077: // standard call back methods
078: public void setEntityContext(EntityContext ec) {
079: if (logger == null)
080: logger = Log.getLogger(Log.JONAS_TESTS_PREFIX);
081: logger.log(BasicLevel.DEBUG, "");
082: ejbContext = ec;
083: }
084:
085: public void unsetEntityContext() {
086: logger.log(BasicLevel.DEBUG, "");
087: ejbContext = null;
088: }
089:
090: public void ejbLoad() {
091: logger.log(BasicLevel.DEBUG, "");
092: }
093:
094: public void ejbStore() {
095: logger.log(BasicLevel.DEBUG, "");
096: }
097:
098: public void ejbActivate() {
099: logger.log(BasicLevel.DEBUG, "");
100: }
101:
102: public void ejbPassivate() {
103: logger.log(BasicLevel.DEBUG, "");
104: }
105:
106: public void ejbRemove() throws javax.ejb.RemoveException {
107: logger.log(BasicLevel.DEBUG, "");
108: }
109: }
|