KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > test > iiopperf > ejb > SessionBean


1 /*
2   * JBoss, Home of Professional Open Source
3   * Copyright 2005, JBoss Inc., and individual contributors as indicated
4   * by the @authors tag. See the copyright.txt in the distribution for a
5   * full listing of individual contributors.
6   *
7   * This is free software; you can redistribute it and/or modify it
8   * under the terms of the GNU Lesser General Public License as
9   * published by the Free Software Foundation; either version 2.1 of
10   * the License, or (at your option) any later version.
11   *
12   * This software is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15   * Lesser General Public License for more details.
16   *
17   * You should have received a copy of the GNU Lesser General Public
18   * License along with this software; if not, write to the Free
19   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21   */

22 package org.jboss.test.iiopperf.ejb;
23
24 import javax.ejb.EJBException JavaDoc;
25
26 import java.util.Collection JavaDoc;
27 import java.util.Map JavaDoc;
28 import java.rmi.Remote JavaDoc;
29
30 import org.jboss.test.util.ejb.SessionSupport;
31 import org.jboss.test.iiopperf.interfaces.CMFoo;
32 import org.jboss.test.iiopperf.interfaces.Foo;
33 import org.jboss.test.iiopperf.interfaces.TestException;
34 import org.jboss.test.iiopperf.interfaces.Session;
35 import org.jboss.test.iiopperf.interfaces.Zoo;
36
37 /**
38  * @author Francisco.Reverbel@jboss.org
39  * @version $Revision: 37406 $
40  */

41 public class SessionBean
42    extends SessionSupport
43 {
44    private String JavaDoc str = null;
45    private Remote JavaDoc rem = null;
46    private Session session = null;
47    private Foo foo;
48    private CMFoo cmfoo;
49    private Zoo zoo;
50    private int[] intArray;
51    private String JavaDoc[] strArray;
52    private Foo[] fooArray;
53    private Collection JavaDoc coll;
54    private Map JavaDoc map;
55
56    public void ejbCreate()
57    {
58    }
59
60    public void sendReceiveNothing()
61    {
62    }
63
64    public void sendBoolean(boolean flag)
65    {
66    }
67
68    public boolean receiveBoolean()
69    {
70       return true;
71    }
72
73    public boolean sendReceiveBoolean(boolean flag)
74    {
75       return flag;
76    }
77
78    public void sendChar(char c)
79    {
80    }
81
82    public char receiveChar()
83    {
84       return Character.MAX_VALUE;
85    }
86
87    public char sendReceiveChar(char c)
88    {
89       return c;
90    }
91
92    public void sendByte(byte b)
93    {
94    }
95
96    public byte receiveByte()
97    {
98       return Byte.MAX_VALUE;
99    }
100
101    public byte sendReceiveByte(byte b)
102    {
103       return b;
104    }
105
106    public void sendShort(short s)
107    {
108    }
109
110    public short receiveShort()
111    {
112       return Short.MAX_VALUE;
113    }
114
115    public short sendReceiveShort(short s)
116    {
117       return s;
118    }
119
120    public void sendInt(int i)
121    {
122    }
123
124    public int receiveInt()
125    {
126       return Integer.MAX_VALUE;
127    }
128
129    public int sendReceiveInt(int i)
130    {
131       return i;
132    }
133
134    public void sendLong(long l)
135    {
136    }
137
138    public long receiveLong()
139    {
140       return Long.MAX_VALUE;
141    }
142
143    public long sendReceiveLong(long l)
144    {
145       return l;
146    }
147
148    public void sendFloat(float f)
149    {
150    }
151
152    public float receiveFloat()
153    {
154       return Float.MAX_VALUE;
155    }
156
157    public float sendReceiveFloat(float f)
158    {
159       return f;
160    }
161
162    public void sendDouble(double d)
163    {
164    }
165
166    public double receiveDouble()
167    {
168       return Double.MAX_VALUE;
169    }
170
171    public double sendReceiveDouble(double d)
172    {
173       return d;
174    }
175
176    public void sendString(String JavaDoc str)
177    {
178       this.str = str;
179    }
180
181    public String JavaDoc receiveString()
182    {
183       return this.str;
184    }
185
186    public String JavaDoc sendReceiveString(String JavaDoc s)
187    {
188       return s;
189    }
190
191    public void sendRemote(Remote JavaDoc rem)
192    {
193       this.rem = rem;
194    }
195
196    public Remote JavaDoc receiveRemote()
197    {
198       return this.rem;
199    }
200
201    public Remote JavaDoc sendReceiveRemote(Remote JavaDoc r)
202    {
203       return r;
204    }
205
206    public void sendSessionRef(Session session)
207    {
208      this.session = session;
209    }
210
211    public Session receiveSessionRef()
212    {
213       return this.session;
214    }
215
216    public Session sendReceiveSessionRef(Session s)
217    {
218       return s;
219    }
220
221    public void sendSimpleSerializable(Foo foo)
222    {
223       this.foo = foo;
224    }
225
226    public Foo receiveSimpleSerializable()
227    {
228       return this.foo;
229    }
230
231    public Foo sendReceiveSimpleSerializable(Foo foo)
232    {
233       return foo;
234    }
235
236    public void sendSimpleCustomMarshalledSerializable(CMFoo cmfoo)
237    {
238       this.cmfoo = cmfoo;
239    }
240
241    public CMFoo receiveSimpleCustomMarshalledSerializable()
242    {
243       return this.cmfoo;
244    }
245
246    public CMFoo sendReceiveSimpleCustomMarshalledSerializable(CMFoo cmfoo)
247    {
248       return cmfoo;
249    }
250
251    public void sendNestedSerializable(Zoo zoo)
252    {
253       this.zoo = zoo;
254    }
255
256    public Zoo receiveNestedSerializable()
257    {
258       return this.zoo;
259    }
260
261    public Zoo sendReceiveNestedSerializable(Zoo zoo)
262    {
263       return zoo;
264    }
265
266    public void sendIntArray(int[] a)
267    {
268       this.intArray = a;
269    }
270
271    public int[] receiveIntArray()
272    {
273       return this.intArray;
274    }
275
276    public int[] sendReceiveIntArray(int[] a)
277    {
278       return a;
279    }
280
281    public void sendStringArray(String JavaDoc[] a)
282    {
283       this.strArray = a;
284    }
285
286    public String JavaDoc[] receiveStringArray()
287    {
288       return this.strArray;
289    }
290
291    public String JavaDoc[] sendReceiveStringArray(String JavaDoc[] a)
292    {
293       return a;
294    }
295
296    public void sendArrayOfSerializables(Foo[] a)
297    {
298       this.fooArray = a;
299    }
300
301    public Foo[] receiveArrayOfSerializables()
302    {
303       return fooArray;
304    }
305
306    public Foo[] sendReceiveArrayOfSerializables(Foo[] a)
307    {
308       return a;
309    }
310
311    public void sendCollection(Collection JavaDoc c)
312    {
313       this.coll = c;
314    }
315
316    public Collection JavaDoc receiveCollection()
317    {
318       return this.coll;
319    }
320
321    public Collection JavaDoc sendReceiveCollection(Collection JavaDoc c)
322    {
323       return c;
324    }
325
326    public void sendMap(Map JavaDoc m)
327    {
328       this.map = m;
329    }
330
331    public Map JavaDoc receiveMap()
332    {
333       return this.map;
334    }
335
336    public Map JavaDoc sendReceiveMap(Map JavaDoc m)
337    {
338       return m;
339    }
340
341    public void throwException()
342       throws TestException
343    {
344       throw new TestException();
345    }
346    
347 }
348
Popular Tags