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: * --------------------------------------------------------------------------
023: */
024:
025: package org.objectweb.jonas.jtests.beans.ebasic;
026:
027: import org.objectweb.jonas.common.Log;
028: import org.objectweb.util.monolog.api.Logger;
029: import org.objectweb.util.monolog.api.BasicLevel;
030:
031: /**
032: * This is an entity bean with "container managed persistence version 2".
033: * This bean is used to test an entity with auto generated primary key
034: * @author Jerome Camilleri
035: */
036: public abstract class pkautoObjectEC2 implements javax.ejb.EntityBean {
037:
038: static protected Logger logger = null;
039: javax.ejb.EntityContext ejbContext;
040:
041: public java.lang.Object ejbCreate(int f1, int f2)
042: throws javax.ejb.CreateException {
043: logger.log(BasicLevel.DEBUG, "");
044:
045: // Init here the bean fields
046: setField1(f1);
047: setField2(f2);
048: return null;
049: }
050:
051: public void ejbPostCreate(int f1, int f2) {
052: logger.log(BasicLevel.DEBUG, "");
053: }
054:
055: // ------------------------------------------------------------------
056: // Abstract Accessor methods for Persistent fields
057: // ------------------------------------------------------------------
058: public abstract int getField1();
059:
060: public abstract void setField1(int f1);
061:
062: public abstract int getField2();
063:
064: public abstract void setField2(int f2);
065:
066: // ------------------------------------------------------------------
067: // Standard call back methods
068: // ------------------------------------------------------------------
069:
070: public void setEntityContext(javax.ejb.EntityContext ctx) {
071: if (logger == null) {
072: logger = Log.getLogger("org.objectweb.jonas_tests");
073: }
074: logger.log(BasicLevel.DEBUG, "");
075: ejbContext = ctx;
076: }
077:
078: public void unsetEntityContext() {
079: logger.log(BasicLevel.DEBUG, "");
080: ejbContext = null;
081: }
082:
083: public void ejbRemove() throws javax.ejb.RemoveException {
084: logger.log(BasicLevel.DEBUG, "");
085: }
086:
087: public void ejbLoad() {
088: logger.log(BasicLevel.DEBUG, "");
089: }
090:
091: public void ejbStore() {
092: logger.log(BasicLevel.DEBUG, "");
093: }
094:
095: public void ejbPassivate() {
096: logger.log(BasicLevel.DEBUG, "");
097: }
098:
099: public void ejbActivate() {
100: logger.log(BasicLevel.DEBUG, "");
101: }
102:
103: }
|