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: CreditCardBean.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.util.Date;
029: import javax.ejb.CreateException;
030: import javax.ejb.EntityBean;
031: import javax.ejb.EntityContext;
032:
033: import org.objectweb.jonas.common.Log;
034: import org.objectweb.util.monolog.api.BasicLevel;
035: import org.objectweb.util.monolog.api.Logger;
036:
037: /**
038: * Implementation for bean CreditCard
039: * @author Ph Durieux
040: */
041: public abstract class CreditCardBean implements EntityBean {
042:
043: static protected Logger logger = null;
044: protected EntityContext ejbContext = null;
045:
046: public Object ejbCreate(Date exp, String numb, String name)
047: throws CreateException {
048: logger.log(BasicLevel.DEBUG, "");
049: setExpirationDate(exp);
050: setNumber(numb);
051: setNameOnCard(name);
052: return null;
053: }
054:
055: public void ejbPostCreate(Date exp, String numb, String name) {
056: logger.log(BasicLevel.DEBUG, "");
057: }
058:
059: // persistent fields
060: public abstract Integer getId();
061:
062: public abstract void setId(Integer id);
063:
064: public abstract Date getExpirationDate();
065:
066: public abstract void setExpirationDate(Date date);
067:
068: public abstract String getNumber();
069:
070: public abstract void setNumber(String number);
071:
072: public abstract String getNameOnCard();
073:
074: public abstract void setNameOnCard(String name);
075:
076: // standard call back methods
077: public void setEntityContext(EntityContext ec) {
078: if (logger == null)
079: logger = Log.getLogger(Log.JONAS_TESTS_PREFIX);
080: logger.log(BasicLevel.DEBUG, "");
081: ejbContext = ec;
082: }
083:
084: public void unsetEntityContext() {
085: logger.log(BasicLevel.DEBUG, "");
086: ejbContext = null;
087: }
088:
089: public void ejbLoad() {
090: logger.log(BasicLevel.DEBUG, "");
091: }
092:
093: public void ejbStore() {
094: logger.log(BasicLevel.DEBUG, "");
095: }
096:
097: public void ejbActivate() {
098: logger.log(BasicLevel.DEBUG, "");
099: }
100:
101: public void ejbPassivate() {
102: logger.log(BasicLevel.DEBUG, "");
103: }
104:
105: public void ejbRemove() throws javax.ejb.RemoveException {
106: logger.log(BasicLevel.DEBUG, "");
107: }
108: }
|