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.iiopperf.ejb;
023:
024: import javax.ejb.EJBException;
025:
026: import java.util.Collection;
027: import java.util.Map;
028: import java.rmi.Remote;
029:
030: import org.jboss.test.util.ejb.SessionSupport;
031: import org.jboss.test.iiopperf.interfaces.CMFoo;
032: import org.jboss.test.iiopperf.interfaces.Foo;
033: import org.jboss.test.iiopperf.interfaces.TestException;
034: import org.jboss.test.iiopperf.interfaces.Session;
035: import org.jboss.test.iiopperf.interfaces.Zoo;
036:
037: /**
038: * @author Francisco.Reverbel@jboss.org
039: * @version $Revision: 57211 $
040: */
041: public class SessionBean extends SessionSupport {
042: private String str = null;
043: private Remote rem = null;
044: private Session session = null;
045: private Foo foo;
046: private CMFoo cmfoo;
047: private Zoo zoo;
048: private int[] intArray;
049: private String[] strArray;
050: private Foo[] fooArray;
051: private Collection coll;
052: private Map map;
053:
054: public void ejbCreate() {
055: }
056:
057: public void sendReceiveNothing() {
058: }
059:
060: public void sendBoolean(boolean flag) {
061: }
062:
063: public boolean receiveBoolean() {
064: return true;
065: }
066:
067: public boolean sendReceiveBoolean(boolean flag) {
068: return flag;
069: }
070:
071: public void sendChar(char c) {
072: }
073:
074: public char receiveChar() {
075: return Character.MAX_VALUE;
076: }
077:
078: public char sendReceiveChar(char c) {
079: return c;
080: }
081:
082: public void sendByte(byte b) {
083: }
084:
085: public byte receiveByte() {
086: return Byte.MAX_VALUE;
087: }
088:
089: public byte sendReceiveByte(byte b) {
090: return b;
091: }
092:
093: public void sendShort(short s) {
094: }
095:
096: public short receiveShort() {
097: return Short.MAX_VALUE;
098: }
099:
100: public short sendReceiveShort(short s) {
101: return s;
102: }
103:
104: public void sendInt(int i) {
105: }
106:
107: public int receiveInt() {
108: return Integer.MAX_VALUE;
109: }
110:
111: public int sendReceiveInt(int i) {
112: return i;
113: }
114:
115: public void sendLong(long l) {
116: }
117:
118: public long receiveLong() {
119: return Long.MAX_VALUE;
120: }
121:
122: public long sendReceiveLong(long l) {
123: return l;
124: }
125:
126: public void sendFloat(float f) {
127: }
128:
129: public float receiveFloat() {
130: return Float.MAX_VALUE;
131: }
132:
133: public float sendReceiveFloat(float f) {
134: return f;
135: }
136:
137: public void sendDouble(double d) {
138: }
139:
140: public double receiveDouble() {
141: return Double.MAX_VALUE;
142: }
143:
144: public double sendReceiveDouble(double d) {
145: return d;
146: }
147:
148: public void sendString(String str) {
149: this .str = str;
150: }
151:
152: public String receiveString() {
153: return this .str;
154: }
155:
156: public String sendReceiveString(String s) {
157: return s;
158: }
159:
160: public void sendRemote(Remote rem) {
161: this .rem = rem;
162: }
163:
164: public Remote receiveRemote() {
165: return this .rem;
166: }
167:
168: public Remote sendReceiveRemote(Remote r) {
169: return r;
170: }
171:
172: public void sendSessionRef(Session session) {
173: this .session = session;
174: }
175:
176: public Session receiveSessionRef() {
177: return this .session;
178: }
179:
180: public Session sendReceiveSessionRef(Session s) {
181: return s;
182: }
183:
184: public void sendSimpleSerializable(Foo foo) {
185: this .foo = foo;
186: }
187:
188: public Foo receiveSimpleSerializable() {
189: return this .foo;
190: }
191:
192: public Foo sendReceiveSimpleSerializable(Foo foo) {
193: return foo;
194: }
195:
196: public void sendSimpleCustomMarshalledSerializable(CMFoo cmfoo) {
197: this .cmfoo = cmfoo;
198: }
199:
200: public CMFoo receiveSimpleCustomMarshalledSerializable() {
201: return this .cmfoo;
202: }
203:
204: public CMFoo sendReceiveSimpleCustomMarshalledSerializable(
205: CMFoo cmfoo) {
206: return cmfoo;
207: }
208:
209: public void sendNestedSerializable(Zoo zoo) {
210: this .zoo = zoo;
211: }
212:
213: public Zoo receiveNestedSerializable() {
214: return this .zoo;
215: }
216:
217: public Zoo sendReceiveNestedSerializable(Zoo zoo) {
218: return zoo;
219: }
220:
221: public void sendIntArray(int[] a) {
222: this .intArray = a;
223: }
224:
225: public int[] receiveIntArray() {
226: return this .intArray;
227: }
228:
229: public int[] sendReceiveIntArray(int[] a) {
230: return a;
231: }
232:
233: public void sendStringArray(String[] a) {
234: this .strArray = a;
235: }
236:
237: public String[] receiveStringArray() {
238: return this .strArray;
239: }
240:
241: public String[] sendReceiveStringArray(String[] a) {
242: return a;
243: }
244:
245: public void sendArrayOfSerializables(Foo[] a) {
246: this .fooArray = a;
247: }
248:
249: public Foo[] receiveArrayOfSerializables() {
250: return fooArray;
251: }
252:
253: public Foo[] sendReceiveArrayOfSerializables(Foo[] a) {
254: return a;
255: }
256:
257: public void sendCollection(Collection c) {
258: this .coll = c;
259: }
260:
261: public Collection receiveCollection() {
262: return this .coll;
263: }
264:
265: public Collection sendReceiveCollection(Collection c) {
266: return c;
267: }
268:
269: public void sendMap(Map m) {
270: this .map = m;
271: }
272:
273: public Map receiveMap() {
274: return this .map;
275: }
276:
277: public Map sendReceiveMap(Map m) {
278: return m;
279: }
280:
281: public void throwException() throws TestException {
282: throw new TestException();
283: }
284:
285: }
|