~ubuntu-branches/ubuntu/raring/babel/raring-proposed

« back to all changes in this revision

Viewing changes to regression/overload/runJava/sidl_rmi_Response_jniStub.c

  • Committer: Bazaar Package Importer
  • Author(s): Adam C. Powell, IV
  • Date: 2008-08-01 07:56:58 UTC
  • mfrom: (3.1.2 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080801075658-9ezcrbh8dcs8lg70
Tags: 1.2.0.dfsg-6
Added libparsifal-dev as dependency to libsidl-dev (closes: #483324).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * File:          sidl_rmi_Response_jniStub.c
3
 
 * Symbol:        sidl.rmi.Response-v0.9.1
4
 
 * Symbol Type:   interface
5
 
 * Babel Version: 0.10.2
6
 
 * Release:       $Name:  $
7
 
 * Revision:      @(#) $Id: $
8
 
 * Description:   Client-side JNI glue code for sidl.rmi.Response
9
 
 * 
10
 
 * Copyright (c) 2000-2002, The Regents of the University of California.
11
 
 * Produced at the Lawrence Livermore National Laboratory.
12
 
 * Written by the Components Team <components@llnl.gov>
13
 
 * All rights reserved.
14
 
 * 
15
 
 * This file is part of Babel. For more information, see
16
 
 * http://www.llnl.gov/CASC/components/. Please read the COPYRIGHT file
17
 
 * for Our Notice and the LICENSE file for the GNU Lesser General Public
18
 
 * License.
19
 
 * 
20
 
 * This program is free software; you can redistribute it and/or modify it
21
 
 * under the terms of the GNU Lesser General Public License (as published by
22
 
 * the Free Software Foundation) version 2.1 dated February 1999.
23
 
 * 
24
 
 * This program is distributed in the hope that it will be useful, but
25
 
 * WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
26
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
27
 
 * conditions of the GNU Lesser General Public License for more details.
28
 
 * 
29
 
 * You should have recieved a copy of the GNU Lesser General Public License
30
 
 * along with this program; if not, write to the Free Software Foundation,
31
 
 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
32
 
 * 
33
 
 * WARNING: Automatically generated; changes will be lost
34
 
 * 
35
 
 * babel-version = 0.10.2
36
 
 */
37
 
 
38
 
#include "sidl_Java.h"
39
 
#include "sidl_Loader.h"
40
 
#include "sidl_String.h"
41
 
#include "sidl_rmi_Response_IOR.h"
42
 
#include "babel_config.h"
43
 
 
44
 
/*
45
 
 * Convert between jlong and void* pointers.
46
 
 */
47
 
 
48
 
#if (SIZEOF_VOID_P == 8)
49
 
#define JLONG_TO_POINTER(x) ((void*)(x))
50
 
#define POINTER_TO_JLONG(x) ((jlong)(x))
51
 
#else
52
 
#define JLONG_TO_POINTER(x) ((void*)(int32_t)(x))
53
 
#define POINTER_TO_JLONG(x) ((jlong)(int32_t)(x))
54
 
#endif
55
 
 
56
 
#ifndef NULL
57
 
#define NULL 0
58
 
#endif
59
 
 
60
 
/*
61
 
 * Function to extract IOR reference from the Java object.
62
 
 */
63
 
 
64
 
static struct sidl_rmi_Response__object* _get_ior(
65
 
  JNIEnv* env,
66
 
  jobject obj)
67
 
{
68
 
  void* ptr = NULL;
69
 
  static jmethodID mid = (jmethodID) NULL;
70
 
 
71
 
  if (mid == (jmethodID) NULL) {
72
 
    jclass cls = (*env)->GetObjectClass(env, obj);
73
 
    mid = (*env)->GetMethodID(env, cls, "_get_ior", "()J");
74
 
    (*env)->DeleteLocalRef(env, cls);
75
 
  }
76
 
 
77
 
  ptr = JLONG_TO_POINTER((*env)->CallLongMethod(env, obj, mid));
78
 
  return (struct sidl_rmi_Response__object*) ptr;
79
 
}
80
 
 
81
 
/*
82
 
 * <p>
83
 
 * Add one to the intrinsic reference count in the underlying object.
84
 
 * Object in <code>sidl</code> have an intrinsic reference count.
85
 
 * Objects continue to exist as long as the reference count is
86
 
 * positive. Clients should call this method whenever they
87
 
 * create another ongoing reference to an object or interface.
88
 
 * </p>
89
 
 * <p>
90
 
 * This does not have a return value because there is no language
91
 
 * independent type that can refer to an interface or a
92
 
 * class.
93
 
 * </p>
94
 
 */
95
 
 
96
 
static void
97
 
jni_addRef(
98
 
  JNIEnv* env,
99
 
  jobject obj)
100
 
{
101
 
  /*
102
 
   * Declare return and temporary variables.
103
 
   */
104
 
 
105
 
  struct sidl_rmi_Response__object* _ior = NULL;
106
 
 
107
 
  /*
108
 
   * Preprocess Java types and convert into IOR.
109
 
   */
110
 
 
111
 
  _ior = _get_ior(env, obj);
112
 
 
113
 
  /*
114
 
   * Call the IOR method through the EPV.
115
 
   */
116
 
 
117
 
  (*(_ior->d_epv->f_addRef))(
118
 
    _ior->d_object);
119
 
 
120
 
  /*
121
 
   * Postprocess OUT, INOUT, returns, and exceptions.
122
 
   */
123
 
 
124
 
}
125
 
 
126
 
/*
127
 
 * Decrease by one the intrinsic reference count in the underlying
128
 
 * object, and delete the object if the reference is non-positive.
129
 
 * Objects in <code>sidl</code> have an intrinsic reference count.
130
 
 * Clients should call this method whenever they remove a
131
 
 * reference to an object or interface.
132
 
 */
133
 
 
134
 
static void
135
 
jni_deleteRef(
136
 
  JNIEnv* env,
137
 
  jobject obj)
138
 
{
139
 
  /*
140
 
   * Declare return and temporary variables.
141
 
   */
142
 
 
143
 
  struct sidl_rmi_Response__object* _ior = NULL;
144
 
 
145
 
  /*
146
 
   * Preprocess Java types and convert into IOR.
147
 
   */
148
 
 
149
 
  _ior = _get_ior(env, obj);
150
 
 
151
 
  /*
152
 
   * Call the IOR method through the EPV.
153
 
   */
154
 
 
155
 
  (*(_ior->d_epv->f_deleteRef))(
156
 
    _ior->d_object);
157
 
 
158
 
  /*
159
 
   * Postprocess OUT, INOUT, returns, and exceptions.
160
 
   */
161
 
 
162
 
}
163
 
 
164
 
/*
165
 
 * Return true if and only if <code>obj</code> refers to the same
166
 
 * object as this object.
167
 
 */
168
 
 
169
 
static jboolean
170
 
jni_isSame(
171
 
  JNIEnv* env,
172
 
  jobject obj,
173
 
  jobject _arg_iobj)
174
 
{
175
 
  /*
176
 
   * Declare return and temporary variables.
177
 
   */
178
 
 
179
 
  struct sidl_rmi_Response__object* _ior = NULL;
180
 
  struct sidl_BaseInterface__object* _tmp_iobj = (struct 
181
 
    sidl_BaseInterface__object*) NULL;
182
 
  sidl_bool _ior_res = FALSE;
183
 
  jboolean _res = JNI_FALSE;
184
 
 
185
 
  /*
186
 
   * Preprocess Java types and convert into IOR.
187
 
   */
188
 
 
189
 
  _ior = _get_ior(env, obj);
190
 
  _tmp_iobj = (struct sidl_BaseInterface__object*) sidl_Java_J2I_ifc(env,
191
 
    _arg_iobj, "sidl.BaseInterface");
192
 
 
193
 
  /*
194
 
   * Call the IOR method through the EPV.
195
 
   */
196
 
 
197
 
  _ior_res = (*(_ior->d_epv->f_isSame))(
198
 
    _ior->d_object,
199
 
    _tmp_iobj);
200
 
 
201
 
  /*
202
 
   * Postprocess OUT, INOUT, returns, and exceptions.
203
 
   */
204
 
 
205
 
  _res = (jboolean) _ior_res;
206
 
 
207
 
  return _res;
208
 
}
209
 
 
210
 
/*
211
 
 * Check whether the object can support the specified interface or
212
 
 * class.  If the <code>sidl</code> type name in <code>name</code>
213
 
 * is supported, then a reference to that object is returned with the
214
 
 * reference count incremented.  The callee will be responsible for
215
 
 * calling <code>deleteRef</code> on the returned object.  If
216
 
 * the specified type is not supported, then a null reference is
217
 
 * returned.
218
 
 */
219
 
 
220
 
static jobject
221
 
jni_queryInt(
222
 
  JNIEnv* env,
223
 
  jobject obj,
224
 
  jstring _arg_name)
225
 
{
226
 
  /*
227
 
   * Declare return and temporary variables.
228
 
   */
229
 
 
230
 
  struct sidl_rmi_Response__object* _ior = NULL;
231
 
  char* _tmp_name = (char*) NULL;
232
 
  struct sidl_BaseInterface__object* _ior_res = (struct 
233
 
    sidl_BaseInterface__object*) NULL;
234
 
  jobject _res = (jobject) NULL;
235
 
 
236
 
  /*
237
 
   * Preprocess Java types and convert into IOR.
238
 
   */
239
 
 
240
 
  _ior = _get_ior(env, obj);
241
 
  _tmp_name = sidl_Java_J2I_string(env, _arg_name);
242
 
 
243
 
  /*
244
 
   * Call the IOR method through the EPV.
245
 
   */
246
 
 
247
 
  _ior_res = (*(_ior->d_epv->f_queryInt))(
248
 
    _ior->d_object,
249
 
    _tmp_name);
250
 
 
251
 
  /*
252
 
   * Postprocess OUT, INOUT, returns, and exceptions.
253
 
   */
254
 
 
255
 
  sidl_String_free(_tmp_name);
256
 
  _res = sidl_Java_I2J_ifc(env, _ior_res, "sidl.BaseInterface");
257
 
 
258
 
  return _res;
259
 
}
260
 
 
261
 
/*
262
 
 * Return whether this object is an instance of the specified type.
263
 
 * The string name must be the <code>sidl</code> type name.  This
264
 
 * routine will return <code>true</code> if and only if a cast to
265
 
 * the string type name would succeed.
266
 
 */
267
 
 
268
 
static jboolean
269
 
jni_isType(
270
 
  JNIEnv* env,
271
 
  jobject obj,
272
 
  jstring _arg_name)
273
 
{
274
 
  /*
275
 
   * Declare return and temporary variables.
276
 
   */
277
 
 
278
 
  struct sidl_rmi_Response__object* _ior = NULL;
279
 
  char* _tmp_name = (char*) NULL;
280
 
  sidl_bool _ior_res = FALSE;
281
 
  jboolean _res = JNI_FALSE;
282
 
 
283
 
  /*
284
 
   * Preprocess Java types and convert into IOR.
285
 
   */
286
 
 
287
 
  _ior = _get_ior(env, obj);
288
 
  _tmp_name = sidl_Java_J2I_string(env, _arg_name);
289
 
 
290
 
  /*
291
 
   * Call the IOR method through the EPV.
292
 
   */
293
 
 
294
 
  _ior_res = (*(_ior->d_epv->f_isType))(
295
 
    _ior->d_object,
296
 
    _tmp_name);
297
 
 
298
 
  /*
299
 
   * Postprocess OUT, INOUT, returns, and exceptions.
300
 
   */
301
 
 
302
 
  sidl_String_free(_tmp_name);
303
 
  _res = (jboolean) _ior_res;
304
 
 
305
 
  return _res;
306
 
}
307
 
 
308
 
/*
309
 
 * Return the meta-data about the class implementing this interface.
310
 
 */
311
 
 
312
 
static jobject
313
 
jni_getClassInfo(
314
 
  JNIEnv* env,
315
 
  jobject obj)
316
 
{
317
 
  /*
318
 
   * Declare return and temporary variables.
319
 
   */
320
 
 
321
 
  struct sidl_rmi_Response__object* _ior = NULL;
322
 
  struct sidl_ClassInfo__object* _ior_res = (struct sidl_ClassInfo__object*) 
323
 
    NULL;
324
 
  jobject _res = (jobject) NULL;
325
 
 
326
 
  /*
327
 
   * Preprocess Java types and convert into IOR.
328
 
   */
329
 
 
330
 
  _ior = _get_ior(env, obj);
331
 
 
332
 
  /*
333
 
   * Call the IOR method through the EPV.
334
 
   */
335
 
 
336
 
  _ior_res = (*(_ior->d_epv->f_getClassInfo))(
337
 
    _ior->d_object);
338
 
 
339
 
  /*
340
 
   * Postprocess OUT, INOUT, returns, and exceptions.
341
 
   */
342
 
 
343
 
  _res = sidl_Java_I2J_ifc(env, _ior_res, "sidl.ClassInfo");
344
 
 
345
 
  return _res;
346
 
}
347
 
 
348
 
/*
349
 
 * Method:  unpackBool[]
350
 
 */
351
 
 
352
 
static void
353
 
jni_unpackBool(
354
 
  JNIEnv* env,
355
 
  jobject obj,
356
 
  jstring _arg_key,
357
 
  jobject _arg_value)
358
 
{
359
 
  /*
360
 
   * Declare return and temporary variables.
361
 
   */
362
 
 
363
 
  struct sidl_rmi_Response__object* _ior = NULL;
364
 
  char* _tmp_key = (char*) NULL;
365
 
  sidl_bool _tmp_value = FALSE;
366
 
  struct sidl_BaseInterface__object* _ex = NULL;
367
 
 
368
 
  /*
369
 
   * Preprocess Java types and convert into IOR.
370
 
   */
371
 
 
372
 
  _ior = _get_ior(env, obj);
373
 
  _tmp_key = sidl_Java_J2I_string(env, _arg_key);
374
 
  if(_arg_value== NULL) {
375
 
    jclass newExcCls = (*env)->FindClass(env, "java/lang/RuntimeException");
376
 
    (*env)->ThrowNew(env, newExcCls, "Null Holder Sent as OUT Argument");
377
 
    return;
378
 
    }
379
 
 
380
 
  /*
381
 
   * Call the IOR method through the EPV.
382
 
   */
383
 
 
384
 
  (*(_ior->d_epv->f_unpackBool))(
385
 
    _ior->d_object,
386
 
    _tmp_key,
387
 
    &_tmp_value,
388
 
    &_ex);
389
 
 
390
 
  /*
391
 
   * Postprocess OUT, INOUT, returns, and exceptions.
392
 
   */
393
 
 
394
 
  sidl_String_free(_tmp_key);
395
 
  sidl_Java_I2J_boolean_holder(env, _arg_value, _tmp_value);
396
 
  sidl_Java_CheckException(
397
 
    env,
398
 
    _ex,
399
 
    "sidl.io.IOException",
400
 
    NULL);
401
 
}
402
 
 
403
 
/*
404
 
 * Method:  unpackChar[]
405
 
 */
406
 
 
407
 
static void
408
 
jni_unpackChar(
409
 
  JNIEnv* env,
410
 
  jobject obj,
411
 
  jstring _arg_key,
412
 
  jobject _arg_value)
413
 
{
414
 
  /*
415
 
   * Declare return and temporary variables.
416
 
   */
417
 
 
418
 
  struct sidl_rmi_Response__object* _ior = NULL;
419
 
  char* _tmp_key = (char*) NULL;
420
 
  char _tmp_value = (char) 0;
421
 
  struct sidl_BaseInterface__object* _ex = NULL;
422
 
 
423
 
  /*
424
 
   * Preprocess Java types and convert into IOR.
425
 
   */
426
 
 
427
 
  _ior = _get_ior(env, obj);
428
 
  _tmp_key = sidl_Java_J2I_string(env, _arg_key);
429
 
  if(_arg_value== NULL) {
430
 
    jclass newExcCls = (*env)->FindClass(env, "java/lang/RuntimeException");
431
 
    (*env)->ThrowNew(env, newExcCls, "Null Holder Sent as OUT Argument");
432
 
    return;
433
 
    }
434
 
 
435
 
  /*
436
 
   * Call the IOR method through the EPV.
437
 
   */
438
 
 
439
 
  (*(_ior->d_epv->f_unpackChar))(
440
 
    _ior->d_object,
441
 
    _tmp_key,
442
 
    &_tmp_value,
443
 
    &_ex);
444
 
 
445
 
  /*
446
 
   * Postprocess OUT, INOUT, returns, and exceptions.
447
 
   */
448
 
 
449
 
  sidl_String_free(_tmp_key);
450
 
  sidl_Java_I2J_character_holder(env, _arg_value, _tmp_value);
451
 
  sidl_Java_CheckException(
452
 
    env,
453
 
    _ex,
454
 
    "sidl.io.IOException",
455
 
    NULL);
456
 
}
457
 
 
458
 
/*
459
 
 * Method:  unpackInt[]
460
 
 */
461
 
 
462
 
static void
463
 
jni_unpackInt(
464
 
  JNIEnv* env,
465
 
  jobject obj,
466
 
  jstring _arg_key,
467
 
  jobject _arg_value)
468
 
{
469
 
  /*
470
 
   * Declare return and temporary variables.
471
 
   */
472
 
 
473
 
  struct sidl_rmi_Response__object* _ior = NULL;
474
 
  char* _tmp_key = (char*) NULL;
475
 
  int32_t _tmp_value = 0;
476
 
  struct sidl_BaseInterface__object* _ex = NULL;
477
 
 
478
 
  /*
479
 
   * Preprocess Java types and convert into IOR.
480
 
   */
481
 
 
482
 
  _ior = _get_ior(env, obj);
483
 
  _tmp_key = sidl_Java_J2I_string(env, _arg_key);
484
 
  if(_arg_value== NULL) {
485
 
    jclass newExcCls = (*env)->FindClass(env, "java/lang/RuntimeException");
486
 
    (*env)->ThrowNew(env, newExcCls, "Null Holder Sent as OUT Argument");
487
 
    return;
488
 
    }
489
 
 
490
 
  /*
491
 
   * Call the IOR method through the EPV.
492
 
   */
493
 
 
494
 
  (*(_ior->d_epv->f_unpackInt))(
495
 
    _ior->d_object,
496
 
    _tmp_key,
497
 
    &_tmp_value,
498
 
    &_ex);
499
 
 
500
 
  /*
501
 
   * Postprocess OUT, INOUT, returns, and exceptions.
502
 
   */
503
 
 
504
 
  sidl_String_free(_tmp_key);
505
 
  sidl_Java_I2J_int_holder(env, _arg_value, _tmp_value);
506
 
  sidl_Java_CheckException(
507
 
    env,
508
 
    _ex,
509
 
    "sidl.io.IOException",
510
 
    NULL);
511
 
}
512
 
 
513
 
/*
514
 
 * Method:  unpackLong[]
515
 
 */
516
 
 
517
 
static void
518
 
jni_unpackLong(
519
 
  JNIEnv* env,
520
 
  jobject obj,
521
 
  jstring _arg_key,
522
 
  jobject _arg_value)
523
 
{
524
 
  /*
525
 
   * Declare return and temporary variables.
526
 
   */
527
 
 
528
 
  struct sidl_rmi_Response__object* _ior = NULL;
529
 
  char* _tmp_key = (char*) NULL;
530
 
  int64_t _tmp_value = 0;
531
 
  struct sidl_BaseInterface__object* _ex = NULL;
532
 
 
533
 
  /*
534
 
   * Preprocess Java types and convert into IOR.
535
 
   */
536
 
 
537
 
  _ior = _get_ior(env, obj);
538
 
  _tmp_key = sidl_Java_J2I_string(env, _arg_key);
539
 
  if(_arg_value== NULL) {
540
 
    jclass newExcCls = (*env)->FindClass(env, "java/lang/RuntimeException");
541
 
    (*env)->ThrowNew(env, newExcCls, "Null Holder Sent as OUT Argument");
542
 
    return;
543
 
    }
544
 
 
545
 
  /*
546
 
   * Call the IOR method through the EPV.
547
 
   */
548
 
 
549
 
  (*(_ior->d_epv->f_unpackLong))(
550
 
    _ior->d_object,
551
 
    _tmp_key,
552
 
    &_tmp_value,
553
 
    &_ex);
554
 
 
555
 
  /*
556
 
   * Postprocess OUT, INOUT, returns, and exceptions.
557
 
   */
558
 
 
559
 
  sidl_String_free(_tmp_key);
560
 
  sidl_Java_I2J_long_holder(env, _arg_value, _tmp_value);
561
 
  sidl_Java_CheckException(
562
 
    env,
563
 
    _ex,
564
 
    "sidl.io.IOException",
565
 
    NULL);
566
 
}
567
 
 
568
 
/*
569
 
 * Method:  unpackFloat[]
570
 
 */
571
 
 
572
 
static void
573
 
jni_unpackFloat(
574
 
  JNIEnv* env,
575
 
  jobject obj,
576
 
  jstring _arg_key,
577
 
  jobject _arg_value)
578
 
{
579
 
  /*
580
 
   * Declare return and temporary variables.
581
 
   */
582
 
 
583
 
  struct sidl_rmi_Response__object* _ior = NULL;
584
 
  char* _tmp_key = (char*) NULL;
585
 
  float _tmp_value = 0.0;
586
 
  struct sidl_BaseInterface__object* _ex = NULL;
587
 
 
588
 
  /*
589
 
   * Preprocess Java types and convert into IOR.
590
 
   */
591
 
 
592
 
  _ior = _get_ior(env, obj);
593
 
  _tmp_key = sidl_Java_J2I_string(env, _arg_key);
594
 
  if(_arg_value== NULL) {
595
 
    jclass newExcCls = (*env)->FindClass(env, "java/lang/RuntimeException");
596
 
    (*env)->ThrowNew(env, newExcCls, "Null Holder Sent as OUT Argument");
597
 
    return;
598
 
    }
599
 
 
600
 
  /*
601
 
   * Call the IOR method through the EPV.
602
 
   */
603
 
 
604
 
  (*(_ior->d_epv->f_unpackFloat))(
605
 
    _ior->d_object,
606
 
    _tmp_key,
607
 
    &_tmp_value,
608
 
    &_ex);
609
 
 
610
 
  /*
611
 
   * Postprocess OUT, INOUT, returns, and exceptions.
612
 
   */
613
 
 
614
 
  sidl_String_free(_tmp_key);
615
 
  sidl_Java_I2J_float_holder(env, _arg_value, _tmp_value);
616
 
  sidl_Java_CheckException(
617
 
    env,
618
 
    _ex,
619
 
    "sidl.io.IOException",
620
 
    NULL);
621
 
}
622
 
 
623
 
/*
624
 
 * Method:  unpackDouble[]
625
 
 */
626
 
 
627
 
static void
628
 
jni_unpackDouble(
629
 
  JNIEnv* env,
630
 
  jobject obj,
631
 
  jstring _arg_key,
632
 
  jobject _arg_value)
633
 
{
634
 
  /*
635
 
   * Declare return and temporary variables.
636
 
   */
637
 
 
638
 
  struct sidl_rmi_Response__object* _ior = NULL;
639
 
  char* _tmp_key = (char*) NULL;
640
 
  double _tmp_value = 0.0;
641
 
  struct sidl_BaseInterface__object* _ex = NULL;
642
 
 
643
 
  /*
644
 
   * Preprocess Java types and convert into IOR.
645
 
   */
646
 
 
647
 
  _ior = _get_ior(env, obj);
648
 
  _tmp_key = sidl_Java_J2I_string(env, _arg_key);
649
 
  if(_arg_value== NULL) {
650
 
    jclass newExcCls = (*env)->FindClass(env, "java/lang/RuntimeException");
651
 
    (*env)->ThrowNew(env, newExcCls, "Null Holder Sent as OUT Argument");
652
 
    return;
653
 
    }
654
 
 
655
 
  /*
656
 
   * Call the IOR method through the EPV.
657
 
   */
658
 
 
659
 
  (*(_ior->d_epv->f_unpackDouble))(
660
 
    _ior->d_object,
661
 
    _tmp_key,
662
 
    &_tmp_value,
663
 
    &_ex);
664
 
 
665
 
  /*
666
 
   * Postprocess OUT, INOUT, returns, and exceptions.
667
 
   */
668
 
 
669
 
  sidl_String_free(_tmp_key);
670
 
  sidl_Java_I2J_double_holder(env, _arg_value, _tmp_value);
671
 
  sidl_Java_CheckException(
672
 
    env,
673
 
    _ex,
674
 
    "sidl.io.IOException",
675
 
    NULL);
676
 
}
677
 
 
678
 
/*
679
 
 * Method:  unpackFcomplex[]
680
 
 */
681
 
 
682
 
static void
683
 
jni_unpackFcomplex(
684
 
  JNIEnv* env,
685
 
  jobject obj,
686
 
  jstring _arg_key,
687
 
  jobject _arg_value)
688
 
{
689
 
  /*
690
 
   * Declare return and temporary variables.
691
 
   */
692
 
 
693
 
  struct sidl_rmi_Response__object* _ior = NULL;
694
 
  char* _tmp_key = (char*) NULL;
695
 
  struct sidl_fcomplex _tmp_value = { 0.0, 0.0 };
696
 
  struct sidl_BaseInterface__object* _ex = NULL;
697
 
 
698
 
  /*
699
 
   * Preprocess Java types and convert into IOR.
700
 
   */
701
 
 
702
 
  _ior = _get_ior(env, obj);
703
 
  _tmp_key = sidl_Java_J2I_string(env, _arg_key);
704
 
  if(_arg_value== NULL) {
705
 
    jclass newExcCls = (*env)->FindClass(env, "java/lang/RuntimeException");
706
 
    (*env)->ThrowNew(env, newExcCls, "Null Holder Sent as OUT Argument");
707
 
    return;
708
 
    }
709
 
 
710
 
  /*
711
 
   * Call the IOR method through the EPV.
712
 
   */
713
 
 
714
 
  (*(_ior->d_epv->f_unpackFcomplex))(
715
 
    _ior->d_object,
716
 
    _tmp_key,
717
 
    &_tmp_value,
718
 
    &_ex);
719
 
 
720
 
  /*
721
 
   * Postprocess OUT, INOUT, returns, and exceptions.
722
 
   */
723
 
 
724
 
  sidl_String_free(_tmp_key);
725
 
  sidl_Java_I2J_fcomplex_holder(env, _arg_value, &_tmp_value);
726
 
  sidl_Java_CheckException(
727
 
    env,
728
 
    _ex,
729
 
    "sidl.io.IOException",
730
 
    NULL);
731
 
}
732
 
 
733
 
/*
734
 
 * Method:  unpackDcomplex[]
735
 
 */
736
 
 
737
 
static void
738
 
jni_unpackDcomplex(
739
 
  JNIEnv* env,
740
 
  jobject obj,
741
 
  jstring _arg_key,
742
 
  jobject _arg_value)
743
 
{
744
 
  /*
745
 
   * Declare return and temporary variables.
746
 
   */
747
 
 
748
 
  struct sidl_rmi_Response__object* _ior = NULL;
749
 
  char* _tmp_key = (char*) NULL;
750
 
  struct sidl_dcomplex _tmp_value = { 0.0, 0.0 };
751
 
  struct sidl_BaseInterface__object* _ex = NULL;
752
 
 
753
 
  /*
754
 
   * Preprocess Java types and convert into IOR.
755
 
   */
756
 
 
757
 
  _ior = _get_ior(env, obj);
758
 
  _tmp_key = sidl_Java_J2I_string(env, _arg_key);
759
 
  if(_arg_value== NULL) {
760
 
    jclass newExcCls = (*env)->FindClass(env, "java/lang/RuntimeException");
761
 
    (*env)->ThrowNew(env, newExcCls, "Null Holder Sent as OUT Argument");
762
 
    return;
763
 
    }
764
 
 
765
 
  /*
766
 
   * Call the IOR method through the EPV.
767
 
   */
768
 
 
769
 
  (*(_ior->d_epv->f_unpackDcomplex))(
770
 
    _ior->d_object,
771
 
    _tmp_key,
772
 
    &_tmp_value,
773
 
    &_ex);
774
 
 
775
 
  /*
776
 
   * Postprocess OUT, INOUT, returns, and exceptions.
777
 
   */
778
 
 
779
 
  sidl_String_free(_tmp_key);
780
 
  sidl_Java_I2J_dcomplex_holder(env, _arg_value, &_tmp_value);
781
 
  sidl_Java_CheckException(
782
 
    env,
783
 
    _ex,
784
 
    "sidl.io.IOException",
785
 
    NULL);
786
 
}
787
 
 
788
 
/*
789
 
 * Method:  unpackString[]
790
 
 */
791
 
 
792
 
static void
793
 
jni_unpackString(
794
 
  JNIEnv* env,
795
 
  jobject obj,
796
 
  jstring _arg_key,
797
 
  jobject _arg_value)
798
 
{
799
 
  /*
800
 
   * Declare return and temporary variables.
801
 
   */
802
 
 
803
 
  struct sidl_rmi_Response__object* _ior = NULL;
804
 
  char* _tmp_key = (char*) NULL;
805
 
  char* _tmp_value = (char*) NULL;
806
 
  struct sidl_BaseInterface__object* _ex = NULL;
807
 
 
808
 
  /*
809
 
   * Preprocess Java types and convert into IOR.
810
 
   */
811
 
 
812
 
  _ior = _get_ior(env, obj);
813
 
  _tmp_key = sidl_Java_J2I_string(env, _arg_key);
814
 
  if(_arg_value== NULL) {
815
 
    jclass newExcCls = (*env)->FindClass(env, "java/lang/RuntimeException");
816
 
    (*env)->ThrowNew(env, newExcCls, "Null Holder Sent as OUT Argument");
817
 
    return;
818
 
    }
819
 
 
820
 
  /*
821
 
   * Call the IOR method through the EPV.
822
 
   */
823
 
 
824
 
  (*(_ior->d_epv->f_unpackString))(
825
 
    _ior->d_object,
826
 
    _tmp_key,
827
 
    &_tmp_value,
828
 
    &_ex);
829
 
 
830
 
  /*
831
 
   * Postprocess OUT, INOUT, returns, and exceptions.
832
 
   */
833
 
 
834
 
  sidl_String_free(_tmp_key);
835
 
  sidl_Java_I2J_string_holder(env, _arg_value, _tmp_value);
836
 
  sidl_String_free(_tmp_value);
837
 
  sidl_Java_CheckException(
838
 
    env,
839
 
    _ex,
840
 
    "sidl.io.IOException",
841
 
    NULL);
842
 
}
843
 
 
844
 
/*
845
 
 * returns true iff RMI hasn't timed out 
846
 
 */
847
 
 
848
 
static jboolean
849
 
jni_timedOut(
850
 
  JNIEnv* env,
851
 
  jobject obj)
852
 
{
853
 
  /*
854
 
   * Declare return and temporary variables.
855
 
   */
856
 
 
857
 
  struct sidl_rmi_Response__object* _ior = NULL;
858
 
  sidl_bool _ior_res = FALSE;
859
 
  jboolean _res = JNI_FALSE;
860
 
  struct sidl_BaseInterface__object* _ex = NULL;
861
 
 
862
 
  /*
863
 
   * Preprocess Java types and convert into IOR.
864
 
   */
865
 
 
866
 
  _ior = _get_ior(env, obj);
867
 
 
868
 
  /*
869
 
   * Call the IOR method through the EPV.
870
 
   */
871
 
 
872
 
  _ior_res = (*(_ior->d_epv->f_timedOut))(
873
 
    _ior->d_object,
874
 
    &_ex);
875
 
 
876
 
  /*
877
 
   * Postprocess OUT, INOUT, returns, and exceptions.
878
 
   */
879
 
 
880
 
  _res = (jboolean) _ior_res;
881
 
  sidl_Java_CheckException(
882
 
    env,
883
 
    _ex,
884
 
    "sidl.rmi.NetworkException",
885
 
    NULL);
886
 
 
887
 
  return _res;
888
 
}
889
 
 
890
 
/*
891
 
 * if returns null, then safe to unpack arguments 
892
 
 */
893
 
 
894
 
static jobject
895
 
jni_getExceptionThrown(
896
 
  JNIEnv* env,
897
 
  jobject obj)
898
 
{
899
 
  /*
900
 
   * Declare return and temporary variables.
901
 
   */
902
 
 
903
 
  struct sidl_rmi_Response__object* _ior = NULL;
904
 
  struct sidl_BaseException__object* _ior_res = (struct 
905
 
    sidl_BaseException__object*) NULL;
906
 
  jobject _res = (jobject) NULL;
907
 
  struct sidl_BaseInterface__object* _ex = NULL;
908
 
 
909
 
  /*
910
 
   * Preprocess Java types and convert into IOR.
911
 
   */
912
 
 
913
 
  _ior = _get_ior(env, obj);
914
 
 
915
 
  /*
916
 
   * Call the IOR method through the EPV.
917
 
   */
918
 
 
919
 
  _ior_res = (*(_ior->d_epv->f_getExceptionThrown))(
920
 
    _ior->d_object,
921
 
    &_ex);
922
 
 
923
 
  /*
924
 
   * Postprocess OUT, INOUT, returns, and exceptions.
925
 
   */
926
 
 
927
 
  _res = sidl_Java_I2J_ifc(env, _ior_res, "sidl.BaseException");
928
 
  sidl_Java_CheckException(
929
 
    env,
930
 
    _ex,
931
 
    "sidl.rmi.NetworkException",
932
 
    NULL);
933
 
 
934
 
  return _res;
935
 
}
936
 
 
937
 
/*
938
 
 * signal that all is complete 
939
 
 */
940
 
 
941
 
static jboolean
942
 
jni_done(
943
 
  JNIEnv* env,
944
 
  jobject obj)
945
 
{
946
 
  /*
947
 
   * Declare return and temporary variables.
948
 
   */
949
 
 
950
 
  struct sidl_rmi_Response__object* _ior = NULL;
951
 
  sidl_bool _ior_res = FALSE;
952
 
  jboolean _res = JNI_FALSE;
953
 
  struct sidl_BaseInterface__object* _ex = NULL;
954
 
 
955
 
  /*
956
 
   * Preprocess Java types and convert into IOR.
957
 
   */
958
 
 
959
 
  _ior = _get_ior(env, obj);
960
 
 
961
 
  /*
962
 
   * Call the IOR method through the EPV.
963
 
   */
964
 
 
965
 
  _ior_res = (*(_ior->d_epv->f_done))(
966
 
    _ior->d_object,
967
 
    &_ex);
968
 
 
969
 
  /*
970
 
   * Postprocess OUT, INOUT, returns, and exceptions.
971
 
   */
972
 
 
973
 
  _res = (jboolean) _ior_res;
974
 
  sidl_Java_CheckException(
975
 
    env,
976
 
    _ex,
977
 
    "sidl.rmi.NetworkException",
978
 
    NULL);
979
 
 
980
 
  return _res;
981
 
}
982
 
 
983
 
/*
984
 
 * Register JNI methods with the Java JVM.
985
 
 */
986
 
 
987
 
void sidl_rmi_Response__register(JNIEnv* env)
988
 
{
989
 
  JNINativeMethod methods[18];
990
 
  jclass cls;
991
 
 
992
 
  methods[0].name      = "addRef";
993
 
  methods[0].signature = "()V";
994
 
  methods[0].fnPtr     = (void *)jni_addRef;
995
 
  methods[1].name      = "deleteRef";
996
 
  methods[1].signature = "()V";
997
 
  methods[1].fnPtr     = (void *)jni_deleteRef;
998
 
  methods[2].name      = "isSame";
999
 
  methods[2].signature = "(Lsidl/BaseInterface;)Z";
1000
 
  methods[2].fnPtr     = (void *)jni_isSame;
1001
 
  methods[3].name      = "queryInt";
1002
 
  methods[3].signature = "(Ljava/lang/String;)Lsidl/BaseInterface;";
1003
 
  methods[3].fnPtr     = (void *)jni_queryInt;
1004
 
  methods[4].name      = "isType";
1005
 
  methods[4].signature = "(Ljava/lang/String;)Z";
1006
 
  methods[4].fnPtr     = (void *)jni_isType;
1007
 
  methods[5].name      = "getClassInfo";
1008
 
  methods[5].signature = "()Lsidl/ClassInfo;";
1009
 
  methods[5].fnPtr     = (void *)jni_getClassInfo;
1010
 
  methods[6].name      = "unpackBool";
1011
 
  methods[6].signature = "(Ljava/lang/String;Lsidl/Boolean$Holder;)V";
1012
 
  methods[6].fnPtr     = (void *)jni_unpackBool;
1013
 
  methods[7].name      = "unpackChar";
1014
 
  methods[7].signature = "(Ljava/lang/String;Lsidl/Character$Holder;)V";
1015
 
  methods[7].fnPtr     = (void *)jni_unpackChar;
1016
 
  methods[8].name      = "unpackInt";
1017
 
  methods[8].signature = "(Ljava/lang/String;Lsidl/Integer$Holder;)V";
1018
 
  methods[8].fnPtr     = (void *)jni_unpackInt;
1019
 
  methods[9].name      = "unpackLong";
1020
 
  methods[9].signature = "(Ljava/lang/String;Lsidl/Long$Holder;)V";
1021
 
  methods[9].fnPtr     = (void *)jni_unpackLong;
1022
 
  methods[10].name      = "unpackFloat";
1023
 
  methods[10].signature = "(Ljava/lang/String;Lsidl/Float$Holder;)V";
1024
 
  methods[10].fnPtr     = (void *)jni_unpackFloat;
1025
 
  methods[11].name      = "unpackDouble";
1026
 
  methods[11].signature = "(Ljava/lang/String;Lsidl/Double$Holder;)V";
1027
 
  methods[11].fnPtr     = (void *)jni_unpackDouble;
1028
 
  methods[12].name      = "unpackFcomplex";
1029
 
  methods[12].signature = "(Ljava/lang/String;Lsidl/FloatComplex$Holder;)V";
1030
 
  methods[12].fnPtr     = (void *)jni_unpackFcomplex;
1031
 
  methods[13].name      = "unpackDcomplex";
1032
 
  methods[13].signature = "(Ljava/lang/String;Lsidl/DoubleComplex$Holder;)V";
1033
 
  methods[13].fnPtr     = (void *)jni_unpackDcomplex;
1034
 
  methods[14].name      = "unpackString";
1035
 
  methods[14].signature = "(Ljava/lang/String;Lsidl/String$Holder;)V";
1036
 
  methods[14].fnPtr     = (void *)jni_unpackString;
1037
 
  methods[15].name      = "timedOut";
1038
 
  methods[15].signature = "()Z";
1039
 
  methods[15].fnPtr     = (void *)jni_timedOut;
1040
 
  methods[16].name      = "getExceptionThrown";
1041
 
  methods[16].signature = "()Lsidl/BaseException;";
1042
 
  methods[16].fnPtr     = (void *)jni_getExceptionThrown;
1043
 
  methods[17].name      = "done";
1044
 
  methods[17].signature = "()Z";
1045
 
  methods[17].fnPtr     = (void *)jni_done;
1046
 
 
1047
 
 
1048
 
  cls = (*env)->FindClass(env, "sidl/rmi/Response$Wrapper");
1049
 
  if (cls) {
1050
 
    (*env)->RegisterNatives(env, cls, methods, 18);
1051
 
    (*env)->DeleteLocalRef(env, cls);
1052
 
  }
1053
 
}