KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jacorb > test > orb > BasicServerImpl


1 package org.jacorb.test.orb;
2
3 /*
4  * JacORB - a free Java ORB
5  *
6  * Copyright (C) 1997-2002 Gerald Brose.
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Library General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Library General Public License for more details.
17  *
18  * You should have received a copy of the GNU Library General Public
19  * License along with this library; if not, write to the Free
20  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21  */

22
23 import org.jacorb.test.BasicServerPOA;
24 import org.omg.CORBA.BooleanHolder JavaDoc;
25 import org.omg.CORBA.ByteHolder JavaDoc;
26 import org.omg.CORBA.DoubleHolder JavaDoc;
27 import org.omg.CORBA.FloatHolder JavaDoc;
28 import org.omg.CORBA.IntHolder JavaDoc;
29 import org.omg.CORBA.LongHolder JavaDoc;
30 import org.omg.CORBA.ShortHolder JavaDoc;
31 import org.omg.CORBA.portable.InputStream JavaDoc;
32 import org.omg.CORBA.portable.OutputStream JavaDoc;
33 import org.omg.CORBA.portable.ResponseHandler JavaDoc;
34
35 public class BasicServerImpl extends BasicServerPOA
36 {
37     public void ping()
38     {
39         return;
40     }
41
42
43     public long bounce_long_long(long x)
44     {
45         return x;
46     }
47
48     public int bounce_long(int x)
49     {
50         return x;
51     }
52
53     public short bounce_short(short x)
54     {
55         return x;
56     }
57
58     public long bounce_unsigned_long_long(long x)
59     {
60         return x;
61     }
62
63     public int bounce_unsigned_long(int x)
64     {
65         return x;
66     }
67
68     public short bounce_unsigned_short(short x)
69     {
70         return x;
71     }
72
73     public void pass_in_long_long(long x)
74     {
75         // nothing
76
}
77
78     public void pass_in_long(int x)
79     {
80         // nothing
81
}
82
83     public void pass_in_short(short x)
84     {
85         // nothing
86
}
87
88     public void pass_in_unsigned_long_long(long x)
89     {
90         // nothing
91
}
92
93     public void pass_in_unsigned_long(int x)
94     {
95         // nothing
96
}
97
98     public void pass_in_unsigned_short(short x)
99     {
100         // nothing
101
}
102
103     public void pass_inout_long_long(LongHolder JavaDoc x)
104     {
105         x.value = x.value + 1;
106     }
107
108     public void pass_inout_long(IntHolder JavaDoc x)
109     {
110         x.value = x.value + 1;
111     }
112
113     public void pass_inout_short(ShortHolder JavaDoc x)
114     {
115         x.value = ( short ) ( x.value + 1 );
116     }
117
118     public void pass_inout_unsigned_long_long(LongHolder JavaDoc x)
119     {
120         x.value = x.value + 1;
121     }
122
123     public void pass_inout_unsigned_long(IntHolder JavaDoc x)
124     {
125         x.value = x.value + 1;
126     }
127
128     public void pass_inout_unsigned_short(ShortHolder JavaDoc x)
129     {
130         x.value = ( short ) ( x.value + 1 );
131     }
132
133     public void pass_out_long_long(LongHolder JavaDoc x)
134     {
135         x.value = 84;
136     }
137
138     public void pass_out_long(IntHolder JavaDoc x)
139     {
140         x.value = 83;
141     }
142
143     public void pass_out_short(ShortHolder JavaDoc x)
144     {
145         x.value = 82;
146     }
147
148     public void pass_out_unsigned_long_long(LongHolder JavaDoc x)
149     {
150         x.value = 81;
151     }
152
153     public void pass_out_unsigned_long(IntHolder JavaDoc x)
154     {
155         x.value = 80;
156     }
157
158     public void pass_out_unsigned_short(ShortHolder JavaDoc x)
159     {
160         x.value = 79;
161     }
162
163     public long return_long_long()
164     {
165         return 0xffeeddccbbaa0099L;
166     }
167
168     public int return_long()
169     {
170         return -17;
171     }
172
173     public short return_short()
174     {
175         return -4;
176     }
177
178     public long return_unsigned_long_long()
179     {
180         return 0xffeeddccbbaa0088L;
181     }
182
183     public int return_unsigned_long()
184     {
185         return 43;
186     }
187
188     public short return_unsigned_short()
189     {
190         return 87;
191     }
192
193     public boolean bounce_boolean(boolean x)
194     {
195         return x;
196     }
197
198     public void pass_in_boolean(boolean x)
199     {
200         // nothing
201
}
202
203     public void pass_inout_boolean(BooleanHolder JavaDoc x)
204     {
205         x.value = !x.value;
206     }
207
208     public void pass_out_boolean(BooleanHolder JavaDoc x)
209     {
210         x.value = true;
211     }
212
213     public boolean return_boolean()
214     {
215         return true;
216     }
217
218     public byte bounce_octet(byte x)
219     {
220         return x;
221     }
222
223     public void pass_in_octet(byte x)
224     {
225         // nothing
226
}
227
228     public void pass_inout_octet(ByteHolder JavaDoc x)
229     {
230         x.value = (byte) (x.value + 1);
231     }
232
233     public void pass_out_octet(ByteHolder JavaDoc x)
234     {
235         x.value = 23;
236     }
237
238     public byte return_octet()
239     {
240         return (byte)0xf0;
241     }
242
243
244     public double bounce_double(double x)
245     {
246         return x;
247     }
248
249     public float bounce_float(float x)
250     {
251         return x;
252     }
253
254     public void pass_in_double(double x)
255     {
256         // nothing
257
}
258
259     public void pass_in_float(float x)
260     {
261         // nothing
262
}
263
264     public void pass_inout_double(DoubleHolder JavaDoc x)
265     {
266         x.value = x.value + 1.0;
267     }
268
269     public void pass_inout_float(FloatHolder JavaDoc x)
270     {
271         x.value = x.value + 1.0F;
272     }
273
274     public void pass_out_double(DoubleHolder JavaDoc x)
275     {
276         x.value = 1234E12;
277     }
278
279     public void pass_out_float(FloatHolder JavaDoc x)
280     {
281         x.value = 0.005F;
282     }
283
284     public double return_double()
285     {
286         return 1E-100;
287     }
288
289     public float return_float()
290     {
291         return 1.5E-1F;
292     }
293
294 }
295
Popular Tags