001: /*
002: * JBoss, Home of Professional Open Source.
003: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
004: * as indicated by the @author tags. See the copyright.txt file in the
005: * distribution for a full listing of individual contributors.
006: *
007: * This is free software; you can redistribute it and/or modify it
008: * under the terms of the GNU Lesser General Public License as
009: * published by the Free Software Foundation; either version 2.1 of
010: * the License, or (at your option) any later version.
011: *
012: * This software is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: *
017: * You should have received a copy of the GNU Lesser General Public
018: * License along with this software; if not, write to the Free
019: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
021: */
022: package org.jboss.test.cts.ejb;
023:
024: import java.rmi.RemoteException;
025: import javax.ejb.EntityBean;
026: import javax.ejb.EntityContext;
027: import javax.ejb.CreateException;
028: import javax.ejb.DuplicateKeyException;
029: import javax.ejb.EJBException;
030:
031: import org.jboss.test.cts.keys.AccountPK;
032: import org.jboss.logging.Logger;
033:
034: /**
035: * A simple cmp2 entity bean implementation
036: * @author Scott.Stark@jboss.org
037: * @version $Revision: 57211 $
038: */
039: public abstract class CtsCmpBean implements EntityBean {
040: static Logger log = Logger.getLogger(CtsCmpBean.class);
041: private EntityContext ctx = null;
042:
043: public AccountPK ejbCreate(AccountPK pk, String personsName)
044: throws CreateException, DuplicateKeyException {
045: log.debug("entry ejbCreate, pk=" + pk);
046: setPk(pk);
047: setPersonsName(personsName);
048: return null;
049: }
050:
051: public void ejbPostCreate(AccountPK pk, String personsName)
052: throws CreateException, DuplicateKeyException,
053: EJBException, RemoteException {
054: log.debug("entry ejbPostCreate, pk=" + pk);
055: }
056:
057: public void ejbLoad() throws EJBException, RemoteException {
058: log.debug("ejbLoad () called");
059:
060: }
061:
062: public void ejbStore() throws EJBException, RemoteException {
063: log.debug("ejbStore () called");
064:
065: }
066:
067: public void ejbRemove() throws EJBException, RemoteException {
068: log.debug("ejbRemove () called");
069:
070: }
071:
072: public void ejbActivate() throws EJBException, RemoteException {
073: log.debug("ejbActivate () called");
074: }
075:
076: public void ejbPassivate() throws EJBException, RemoteException {
077: log.debug("ejbPassivate () called");
078: }
079:
080: public void setEntityContext(EntityContext ctx)
081: throws EJBException, RemoteException {
082: log.debug("setEntityContext called");
083: this .ctx = ctx;
084: }
085:
086: public void unsetEntityContext() throws EJBException,
087: RemoteException {
088: log.debug("unsetEntityContext () called");
089:
090: ctx = null;
091: }
092:
093: public abstract void setPk(AccountPK pk);
094:
095: public abstract AccountPK getPk();
096:
097: public abstract void setPersonsName(String personsName);
098:
099: public abstract String getPersonsName();
100:
101: public abstract void setPersonsAge(int age);
102:
103: public abstract int getPersonsAge();
104:
105: }
|