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: SimpleEC2.java 3845 2003-12-05 14:19:55Z legrasi $
023: * --------------------------------------------------------------------------
024: */
025:
026: package org.objectweb.jonas.jtests.beans.fbasic;
027:
028: import javax.ejb.EJBException;
029: import javax.ejb.EntityBean;
030: import javax.ejb.EntityContext;
031: import javax.ejb.RemoveException;
032: import javax.ejb.CreateException;
033: import javax.ejb.EntityContext;
034:
035: /**
036: * This is an entity bean with "container managed persistence version 2.x".
037: * The state of an instance is stored into a relational database.
038: * The following table should exist :
039: * ebasicSimpleEC2
040: * c_testname varchar(30) primarey key
041: * c_info integer
042: * c_numtest integer
043: * @author Philippe Coq, Philippe Durieux, Helene Joanin
044: */
045:
046: public abstract class SimpleEC2 implements EntityBean {
047:
048: // static protected Logger logger = null;
049:
050: protected EntityContext entityContext;
051:
052: // Get and Set accessor methods of the bean's abstract schema
053: public abstract int getInfo();
054:
055: public abstract void setInfo(int info);
056:
057: public abstract int getNumTest();
058:
059: public abstract void setNumTest(int numtest);
060:
061: public abstract String getTestName();
062:
063: public abstract void setTestName(String testname);
064:
065: public void ejbActivate() {
066: //logger.log(BasicLevel.DEBUG, "");
067: }
068:
069: public void ejbPassivate() {
070: //logger.log(BasicLevel.DEBUG, "");
071: }
072:
073: public void ejbLoad() {
074: //logger.log(BasicLevel.DEBUG, "");
075: }
076:
077: public void ejbStore() {
078: //logger.log(BasicLevel.DEBUG, "");
079: }
080:
081: public void ejbRemove() throws RemoveException {
082: //logger.log(BasicLevel.DEBUG, "");
083: }
084:
085: public void setEntityContext(EntityContext ctx) {
086: //if (logger == null)
087: //logger = Log.getLogger(Log.JONAS_TESTS_PREFIX);
088: //logger.log(BasicLevel.DEBUG, "");
089: entityContext = ctx;
090:
091: }
092:
093: public void unsetEntityContext() {
094: //logger.log(BasicLevel.DEBUG, "");
095: }
096:
097: public String ejbCreate(String name, int info, int num)
098: throws CreateException {
099: //logger.log(BasicLevel.DEBUG, "create"+info+","+name+","+num);
100: setInfo(info);
101: setNumTest(num);
102: setTestName(name);
103: return (null);
104: }
105:
106: public void ejbPostCreate(String name, int info, int num) {
107: //logger.log(BasicLevel.DEBUG, "");
108: }
109:
110: }
|