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.testbeancluster.bean;
023:
024: import javax.ejb.EntityBean;
025: import javax.ejb.EntityContext;
026: import javax.ejb.CreateException;
027: import javax.ejb.RemoveException;
028:
029: import org.jboss.test.testbean.interfaces.AComplexPK;
030: import org.apache.log4j.Category;
031:
032: /** Tests of the cluster cache invalidation framework.
033: * @author Scott.Stark@jboss.org
034: * @version $Revision: 57211 $
035: */
036: public abstract class EntityPKBean implements EntityBean {
037: private static Category log = Category
038: .getInstance(EntityPKBean.class);
039:
040: private EntityContext entityContext;
041:
042: public AComplexPK ejbCreate(boolean aBoolean, int anInt,
043: long aLong, double aDouble, String aString)
044: throws CreateException {
045: log.debug("ejbCreate() called");
046: updateAllValues(new AComplexPK(aBoolean, anInt, aLong, aDouble,
047: aString));
048: return null;
049: }
050:
051: public AComplexPK ejbCreateMETHOD(boolean aBoolean, int anInt,
052: long aLong, double aDouble, String aString)
053: throws CreateException {
054: log.debug("ejbCreateMETHOD() called");
055: updateAllValues(new AComplexPK(aBoolean, anInt, aLong, aDouble,
056: aString));
057: return null;
058: }
059:
060: public void ejbPostCreate(boolean aBoolean, int anInt, long aLong,
061: double aDouble, String aString) throws CreateException {
062: log.debug("ejbPostCreate(pk) called");
063: }
064:
065: public void ejbPostCreateMETHOD(boolean aBoolean, int anInt,
066: long aLong, double aDouble, String aString)
067: throws CreateException {
068: log.debug("ejbPostCreateMETHOD(pk) called");
069: }
070:
071: public void ejbActivate() {
072: log.debug("ejbActivate() called");
073: }
074:
075: public void ejbLoad() {
076: log.debug("ejbLoad() called");
077: }
078:
079: public void ejbPassivate() {
080: log.debug("ejbPassivate() called");
081: }
082:
083: public void ejbRemove() throws RemoveException {
084:
085: log.debug("EntityPK.ejbRemove() called");
086: }
087:
088: public void ejbStore() {
089: log.debug("ejbStore() called");
090: }
091:
092: public void setEntityContext(EntityContext context) {
093: log.debug("setSessionContext() called");
094: entityContext = context;
095: }
096:
097: public void unsetEntityContext() {
098: log.debug("unsetSessionContext() called");
099: entityContext = null;
100: }
101:
102: public void updateAllValues(AComplexPK aComplexPK) {
103: setABoolean(aComplexPK.aBoolean);
104: setADouble(aComplexPK.aDouble);
105: setALong(aComplexPK.aLong);
106: setAnInt(aComplexPK.anInt);
107: setAString(aComplexPK.aString);
108: }
109:
110: public AComplexPK readAllValues() {
111: return new AComplexPK(getABoolean(), getAnInt(), getALong(),
112: getADouble(), getAString());
113: }
114:
115: public abstract boolean getABoolean();
116:
117: public abstract void setABoolean(boolean value);
118:
119: public abstract double getADouble();
120:
121: public abstract void setADouble(double value);
122:
123: public abstract long getALong();
124:
125: public abstract void setALong(long value);
126:
127: public abstract int getAnInt();
128:
129: public abstract void setAnInt(int value);
130:
131: public abstract String getAString();
132:
133: public abstract void setAString(String value);
134:
135: public abstract int getOtherField();
136:
137: public abstract void setOtherField(int newValue);
138:
139: }
|