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: BaseEC2.java 4406 2004-03-19 11:57:20Z benoitf $
023: * --------------------------------------------------------------------------
024: */
025:
026: package org.objectweb.jonas.jtests.beans.secured;
027:
028: import javax.ejb.CreateException;
029: import javax.ejb.EJBContext;
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:
037: /**
038: * This is an entity bean with "container managed persistence 2".
039: * The state of an instance is stored into a relational database.
040: * @author Helene Joanin (jonas team)
041: */
042: public abstract class BaseEC2 extends BaseCommon implements EntityBean {
043:
044: protected EntityContext entityContext;
045:
046: // ------------------------------------------------------------------
047: // Get and Set accessor methods of the bean's abstract schema
048: // ------------------------------------------------------------------
049: public abstract String getInfo();
050:
051: public abstract void setInfo(String n);
052:
053: public abstract String getName();
054:
055: public abstract void setName(String n);
056:
057: public EJBContext getEJBContext() {
058: return entityContext;
059: }
060:
061: public void ejbActivate() {
062: logger.log(BasicLevel.DEBUG, "");
063: }
064:
065: public void ejbPassivate() {
066: logger.log(BasicLevel.DEBUG, "");
067: }
068:
069: public void ejbLoad() {
070: logger.log(BasicLevel.DEBUG, "");
071: }
072:
073: public void ejbStore() {
074: logger.log(BasicLevel.DEBUG, "");
075: }
076:
077: public void ejbRemove() throws RemoveException {
078: logger.log(BasicLevel.DEBUG, "");
079: }
080:
081: public void setEntityContext(EntityContext ctx) {
082: if (logger == null)
083: logger = Log.getLogger(Log.JONAS_TESTS_PREFIX);
084: logger.log(BasicLevel.DEBUG, "");
085: entityContext = ctx;
086:
087: }
088:
089: public void unsetEntityContext() {
090: logger.log(BasicLevel.DEBUG, "");
091: }
092:
093: public String ejbCreate(String name, String info)
094: throws CreateException {
095: logger.log(BasicLevel.DEBUG, "");
096: setInfo(info);
097: setName(name);
098: return (null);
099: }
100:
101: public void ejbPostCreate(String name, String info) {
102: logger.log(BasicLevel.DEBUG, "");
103: }
104:
105: }
|