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.testbean.bean;
023:
024: import java.rmi.*;
025: import javax.ejb.*;
026: import org.jboss.test.testbean.interfaces.AComplexPK;
027:
028: /*
029: * The purpose of this class is to test
030: * 1- the storage of all the types of primitives we know
031: * 2- the complex primary key AComplexPK
032: *
033: */
034:
035: public class EntityPKBean implements EntityBean {
036: org.apache.log4j.Category log = org.apache.log4j.Category
037: .getInstance(getClass());
038: public boolean aBoolean;
039: public int anInt;
040: public long aLong;
041: public double aDouble;
042: public String aString;
043:
044: public int otherField;
045:
046: private EntityContext entityContext;
047:
048: public AComplexPK ejbCreate(boolean aBoolean, int anInt,
049: long aLong, double aDouble, String aString)
050: throws RemoteException, CreateException {
051:
052: log.debug("EntityPK.ejbCreate() called");
053:
054: this .aBoolean = aBoolean;
055: this .anInt = anInt;
056: this .aLong = aLong;
057: this .aDouble = aDouble;
058: this .aString = aString;
059:
060: return new AComplexPK(aBoolean, anInt, aLong, aDouble, aString);
061: }
062:
063: public AComplexPK ejbCreateMETHOD(boolean aBoolean, int anInt,
064: long aLong, double aDouble, String aString)
065: throws RemoteException, CreateException {
066:
067: log.debug("EntityPK.ejbCreateMETHOD() called");
068:
069: this .aBoolean = aBoolean;
070: this .anInt = anInt;
071: this .aLong = aLong;
072: this .aDouble = aDouble;
073: this .aString = aString;
074:
075: return new AComplexPK(aBoolean, anInt, aLong, aDouble, aString);
076: }
077:
078: public void ejbPostCreate(boolean aBoolean, int anInt, long aLong,
079: double aDouble, String aString) throws RemoteException,
080: CreateException {
081:
082: log.debug("EntityPK.ejbPostCreate(pk) called");
083: }
084:
085: public void ejbPostCreateMETHOD(boolean aBoolean, int anInt,
086: long aLong, double aDouble, String aString)
087: throws RemoteException, CreateException {
088:
089: log.debug("EntityPK.ejbPostCreateMETHOD(pk) called");
090: }
091:
092: public void ejbActivate() throws RemoteException {
093:
094: log.debug("EntityPK.ejbActivate() called");
095: }
096:
097: public void ejbLoad() throws RemoteException {
098:
099: log.debug("EntityPK.ejbLoad() called");
100: }
101:
102: public void ejbPassivate() throws RemoteException {
103:
104: log.debug("EntityPK.ejbPassivate() called");
105: }
106:
107: public void ejbRemove() throws RemoteException, RemoveException {
108:
109: log.debug("EntityPK.ejbRemove() called");
110: }
111:
112: public void ejbStore() throws RemoteException {
113:
114: log.debug("EntityPK.ejbStore() called");
115: }
116:
117: public void setEntityContext(EntityContext context)
118: throws RemoteException {
119:
120: log.debug("EntityPK.setSessionContext() called");
121: entityContext = context;
122: }
123:
124: public void unsetEntityContext() throws RemoteException {
125:
126: log.debug("EntityBMP.unsetSessionContext() called");
127: entityContext = null;
128: }
129:
130: public void updateAllValues(AComplexPK aComplexPK)
131: throws RemoteException {
132:
133: this .aBoolean = aComplexPK.aBoolean;
134: this .aDouble = aComplexPK.aDouble;
135: this .aLong = aComplexPK.aLong;
136: this .anInt = aComplexPK.anInt;
137: this .aString = aComplexPK.aString;
138:
139: };
140:
141: public AComplexPK readAllValues() throws RemoteException {
142:
143: return new AComplexPK(aBoolean, anInt, aLong, aDouble, aString);
144:
145: };
146:
147: public int getOtherField() throws RemoteException {
148: return otherField;
149: }
150:
151: public void setOtherField(int newValue) throws RemoteException {
152: otherField = newValue;
153: }
154:
155: }
|