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
7
* Revision: @(#) $Id: $
8
* Description: Client-side JNI glue code for sidl.rmi.Response
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.
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
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.
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.
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
33
* WARNING: Automatically generated; changes will be lost
35
* babel-version = 0.10.2
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"
45
* Convert between jlong and void* pointers.
48
#if (SIZEOF_VOID_P == 8)
49
#define JLONG_TO_POINTER(x) ((void*)(x))
50
#define POINTER_TO_JLONG(x) ((jlong)(x))
52
#define JLONG_TO_POINTER(x) ((void*)(int32_t)(x))
53
#define POINTER_TO_JLONG(x) ((jlong)(int32_t)(x))
61
* Function to extract IOR reference from the Java object.
64
static struct sidl_rmi_Response__object* _get_ior(
69
static jmethodID mid = (jmethodID) NULL;
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);
77
ptr = JLONG_TO_POINTER((*env)->CallLongMethod(env, obj, mid));
78
return (struct sidl_rmi_Response__object*) ptr;
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.
90
* This does not have a return value because there is no language
91
* independent type that can refer to an interface or a
102
* Declare return and temporary variables.
105
struct sidl_rmi_Response__object* _ior = NULL;
108
* Preprocess Java types and convert into IOR.
111
_ior = _get_ior(env, obj);
114
* Call the IOR method through the EPV.
117
(*(_ior->d_epv->f_addRef))(
121
* Postprocess OUT, INOUT, returns, and exceptions.
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.
140
* Declare return and temporary variables.
143
struct sidl_rmi_Response__object* _ior = NULL;
146
* Preprocess Java types and convert into IOR.
149
_ior = _get_ior(env, obj);
152
* Call the IOR method through the EPV.
155
(*(_ior->d_epv->f_deleteRef))(
159
* Postprocess OUT, INOUT, returns, and exceptions.
165
* Return true if and only if <code>obj</code> refers to the same
166
* object as this object.
176
* Declare return and temporary variables.
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;
186
* Preprocess Java types and convert into IOR.
189
_ior = _get_ior(env, obj);
190
_tmp_iobj = (struct sidl_BaseInterface__object*) sidl_Java_J2I_ifc(env,
191
_arg_iobj, "sidl.BaseInterface");
194
* Call the IOR method through the EPV.
197
_ior_res = (*(_ior->d_epv->f_isSame))(
202
* Postprocess OUT, INOUT, returns, and exceptions.
205
_res = (jboolean) _ior_res;
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
227
* Declare return and temporary variables.
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;
237
* Preprocess Java types and convert into IOR.
240
_ior = _get_ior(env, obj);
241
_tmp_name = sidl_Java_J2I_string(env, _arg_name);
244
* Call the IOR method through the EPV.
247
_ior_res = (*(_ior->d_epv->f_queryInt))(
252
* Postprocess OUT, INOUT, returns, and exceptions.
255
sidl_String_free(_tmp_name);
256
_res = sidl_Java_I2J_ifc(env, _ior_res, "sidl.BaseInterface");
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.
275
* Declare return and temporary variables.
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;
284
* Preprocess Java types and convert into IOR.
287
_ior = _get_ior(env, obj);
288
_tmp_name = sidl_Java_J2I_string(env, _arg_name);
291
* Call the IOR method through the EPV.
294
_ior_res = (*(_ior->d_epv->f_isType))(
299
* Postprocess OUT, INOUT, returns, and exceptions.
302
sidl_String_free(_tmp_name);
303
_res = (jboolean) _ior_res;
309
* Return the meta-data about the class implementing this interface.
318
* Declare return and temporary variables.
321
struct sidl_rmi_Response__object* _ior = NULL;
322
struct sidl_ClassInfo__object* _ior_res = (struct sidl_ClassInfo__object*)
324
jobject _res = (jobject) NULL;
327
* Preprocess Java types and convert into IOR.
330
_ior = _get_ior(env, obj);
333
* Call the IOR method through the EPV.
336
_ior_res = (*(_ior->d_epv->f_getClassInfo))(
340
* Postprocess OUT, INOUT, returns, and exceptions.
343
_res = sidl_Java_I2J_ifc(env, _ior_res, "sidl.ClassInfo");
349
* Method: unpackBool[]
360
* Declare return and temporary variables.
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;
369
* Preprocess Java types and convert into IOR.
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");
381
* Call the IOR method through the EPV.
384
(*(_ior->d_epv->f_unpackBool))(
391
* Postprocess OUT, INOUT, returns, and exceptions.
394
sidl_String_free(_tmp_key);
395
sidl_Java_I2J_boolean_holder(env, _arg_value, _tmp_value);
396
sidl_Java_CheckException(
399
"sidl.io.IOException",
404
* Method: unpackChar[]
415
* Declare return and temporary variables.
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;
424
* Preprocess Java types and convert into IOR.
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");
436
* Call the IOR method through the EPV.
439
(*(_ior->d_epv->f_unpackChar))(
446
* Postprocess OUT, INOUT, returns, and exceptions.
449
sidl_String_free(_tmp_key);
450
sidl_Java_I2J_character_holder(env, _arg_value, _tmp_value);
451
sidl_Java_CheckException(
454
"sidl.io.IOException",
459
* Method: unpackInt[]
470
* Declare return and temporary variables.
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;
479
* Preprocess Java types and convert into IOR.
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");
491
* Call the IOR method through the EPV.
494
(*(_ior->d_epv->f_unpackInt))(
501
* Postprocess OUT, INOUT, returns, and exceptions.
504
sidl_String_free(_tmp_key);
505
sidl_Java_I2J_int_holder(env, _arg_value, _tmp_value);
506
sidl_Java_CheckException(
509
"sidl.io.IOException",
514
* Method: unpackLong[]
525
* Declare return and temporary variables.
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;
534
* Preprocess Java types and convert into IOR.
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");
546
* Call the IOR method through the EPV.
549
(*(_ior->d_epv->f_unpackLong))(
556
* Postprocess OUT, INOUT, returns, and exceptions.
559
sidl_String_free(_tmp_key);
560
sidl_Java_I2J_long_holder(env, _arg_value, _tmp_value);
561
sidl_Java_CheckException(
564
"sidl.io.IOException",
569
* Method: unpackFloat[]
580
* Declare return and temporary variables.
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;
589
* Preprocess Java types and convert into IOR.
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");
601
* Call the IOR method through the EPV.
604
(*(_ior->d_epv->f_unpackFloat))(
611
* Postprocess OUT, INOUT, returns, and exceptions.
614
sidl_String_free(_tmp_key);
615
sidl_Java_I2J_float_holder(env, _arg_value, _tmp_value);
616
sidl_Java_CheckException(
619
"sidl.io.IOException",
624
* Method: unpackDouble[]
635
* Declare return and temporary variables.
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;
644
* Preprocess Java types and convert into IOR.
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");
656
* Call the IOR method through the EPV.
659
(*(_ior->d_epv->f_unpackDouble))(
666
* Postprocess OUT, INOUT, returns, and exceptions.
669
sidl_String_free(_tmp_key);
670
sidl_Java_I2J_double_holder(env, _arg_value, _tmp_value);
671
sidl_Java_CheckException(
674
"sidl.io.IOException",
679
* Method: unpackFcomplex[]
690
* Declare return and temporary variables.
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;
699
* Preprocess Java types and convert into IOR.
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");
711
* Call the IOR method through the EPV.
714
(*(_ior->d_epv->f_unpackFcomplex))(
721
* Postprocess OUT, INOUT, returns, and exceptions.
724
sidl_String_free(_tmp_key);
725
sidl_Java_I2J_fcomplex_holder(env, _arg_value, &_tmp_value);
726
sidl_Java_CheckException(
729
"sidl.io.IOException",
734
* Method: unpackDcomplex[]
745
* Declare return and temporary variables.
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;
754
* Preprocess Java types and convert into IOR.
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");
766
* Call the IOR method through the EPV.
769
(*(_ior->d_epv->f_unpackDcomplex))(
776
* Postprocess OUT, INOUT, returns, and exceptions.
779
sidl_String_free(_tmp_key);
780
sidl_Java_I2J_dcomplex_holder(env, _arg_value, &_tmp_value);
781
sidl_Java_CheckException(
784
"sidl.io.IOException",
789
* Method: unpackString[]
800
* Declare return and temporary variables.
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;
809
* Preprocess Java types and convert into IOR.
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");
821
* Call the IOR method through the EPV.
824
(*(_ior->d_epv->f_unpackString))(
831
* Postprocess OUT, INOUT, returns, and exceptions.
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(
840
"sidl.io.IOException",
845
* returns true iff RMI hasn't timed out
854
* Declare return and temporary variables.
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;
863
* Preprocess Java types and convert into IOR.
866
_ior = _get_ior(env, obj);
869
* Call the IOR method through the EPV.
872
_ior_res = (*(_ior->d_epv->f_timedOut))(
877
* Postprocess OUT, INOUT, returns, and exceptions.
880
_res = (jboolean) _ior_res;
881
sidl_Java_CheckException(
884
"sidl.rmi.NetworkException",
891
* if returns null, then safe to unpack arguments
895
jni_getExceptionThrown(
900
* Declare return and temporary variables.
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;
910
* Preprocess Java types and convert into IOR.
913
_ior = _get_ior(env, obj);
916
* Call the IOR method through the EPV.
919
_ior_res = (*(_ior->d_epv->f_getExceptionThrown))(
924
* Postprocess OUT, INOUT, returns, and exceptions.
927
_res = sidl_Java_I2J_ifc(env, _ior_res, "sidl.BaseException");
928
sidl_Java_CheckException(
931
"sidl.rmi.NetworkException",
938
* signal that all is complete
947
* Declare return and temporary variables.
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;
956
* Preprocess Java types and convert into IOR.
959
_ior = _get_ior(env, obj);
962
* Call the IOR method through the EPV.
965
_ior_res = (*(_ior->d_epv->f_done))(
970
* Postprocess OUT, INOUT, returns, and exceptions.
973
_res = (jboolean) _ior_res;
974
sidl_Java_CheckException(
977
"sidl.rmi.NetworkException",
984
* Register JNI methods with the Java JVM.
987
void sidl_rmi_Response__register(JNIEnv* env)
989
JNINativeMethod methods[18];
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;
1048
cls = (*env)->FindClass(env, "sidl/rmi/Response$Wrapper");
1050
(*env)->RegisterNatives(env, cls, methods, 18);
1051
(*env)->DeleteLocalRef(env, cls);