2
* File: sidl_io_Serializer_jniStub.c
3
* Symbol: sidl.io.Serializer-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.io.Serializer
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_io_Serializer_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_io_Serializer__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_io_Serializer__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_io_Serializer__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_io_Serializer__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_io_Serializer__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_io_Serializer__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_io_Serializer__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_io_Serializer__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");
360
* Declare return and temporary variables.
363
struct sidl_io_Serializer__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
_tmp_value = (sidl_bool) _arg_value;
377
* Call the IOR method through the EPV.
380
(*(_ior->d_epv->f_packBool))(
387
* Postprocess OUT, INOUT, returns, and exceptions.
390
sidl_String_free(_tmp_key);
391
sidl_Java_CheckException(
394
"sidl.io.IOException",
410
* Declare return and temporary variables.
413
struct sidl_io_Serializer__object* _ior = NULL;
414
char* _tmp_key = (char*) NULL;
415
char _tmp_value = (char) 0;
416
struct sidl_BaseInterface__object* _ex = NULL;
419
* Preprocess Java types and convert into IOR.
422
_ior = _get_ior(env, obj);
423
_tmp_key = sidl_Java_J2I_string(env, _arg_key);
424
_tmp_value = (char) _arg_value;
427
* Call the IOR method through the EPV.
430
(*(_ior->d_epv->f_packChar))(
437
* Postprocess OUT, INOUT, returns, and exceptions.
440
sidl_String_free(_tmp_key);
441
sidl_Java_CheckException(
444
"sidl.io.IOException",
460
* Declare return and temporary variables.
463
struct sidl_io_Serializer__object* _ior = NULL;
464
char* _tmp_key = (char*) NULL;
465
int32_t _tmp_value = 0;
466
struct sidl_BaseInterface__object* _ex = NULL;
469
* Preprocess Java types and convert into IOR.
472
_ior = _get_ior(env, obj);
473
_tmp_key = sidl_Java_J2I_string(env, _arg_key);
474
_tmp_value = (int32_t) _arg_value;
477
* Call the IOR method through the EPV.
480
(*(_ior->d_epv->f_packInt))(
487
* Postprocess OUT, INOUT, returns, and exceptions.
490
sidl_String_free(_tmp_key);
491
sidl_Java_CheckException(
494
"sidl.io.IOException",
510
* Declare return and temporary variables.
513
struct sidl_io_Serializer__object* _ior = NULL;
514
char* _tmp_key = (char*) NULL;
515
int64_t _tmp_value = 0;
516
struct sidl_BaseInterface__object* _ex = NULL;
519
* Preprocess Java types and convert into IOR.
522
_ior = _get_ior(env, obj);
523
_tmp_key = sidl_Java_J2I_string(env, _arg_key);
524
_tmp_value = (int64_t) _arg_value;
527
* Call the IOR method through the EPV.
530
(*(_ior->d_epv->f_packLong))(
537
* Postprocess OUT, INOUT, returns, and exceptions.
540
sidl_String_free(_tmp_key);
541
sidl_Java_CheckException(
544
"sidl.io.IOException",
549
* Method: packFloat[]
560
* Declare return and temporary variables.
563
struct sidl_io_Serializer__object* _ior = NULL;
564
char* _tmp_key = (char*) NULL;
565
float _tmp_value = 0.0;
566
struct sidl_BaseInterface__object* _ex = NULL;
569
* Preprocess Java types and convert into IOR.
572
_ior = _get_ior(env, obj);
573
_tmp_key = sidl_Java_J2I_string(env, _arg_key);
574
_tmp_value = (float) _arg_value;
577
* Call the IOR method through the EPV.
580
(*(_ior->d_epv->f_packFloat))(
587
* Postprocess OUT, INOUT, returns, and exceptions.
590
sidl_String_free(_tmp_key);
591
sidl_Java_CheckException(
594
"sidl.io.IOException",
599
* Method: packDouble[]
610
* Declare return and temporary variables.
613
struct sidl_io_Serializer__object* _ior = NULL;
614
char* _tmp_key = (char*) NULL;
615
double _tmp_value = 0.0;
616
struct sidl_BaseInterface__object* _ex = NULL;
619
* Preprocess Java types and convert into IOR.
622
_ior = _get_ior(env, obj);
623
_tmp_key = sidl_Java_J2I_string(env, _arg_key);
624
_tmp_value = (double) _arg_value;
627
* Call the IOR method through the EPV.
630
(*(_ior->d_epv->f_packDouble))(
637
* Postprocess OUT, INOUT, returns, and exceptions.
640
sidl_String_free(_tmp_key);
641
sidl_Java_CheckException(
644
"sidl.io.IOException",
649
* Method: packFcomplex[]
660
* Declare return and temporary variables.
663
struct sidl_io_Serializer__object* _ior = NULL;
664
char* _tmp_key = (char*) NULL;
665
struct sidl_fcomplex _tmp_value = { 0.0, 0.0 };
666
struct sidl_BaseInterface__object* _ex = NULL;
669
* Preprocess Java types and convert into IOR.
672
_ior = _get_ior(env, obj);
673
_tmp_key = sidl_Java_J2I_string(env, _arg_key);
674
_tmp_value = sidl_Java_J2I_fcomplex(env, _arg_value);
677
* Call the IOR method through the EPV.
680
(*(_ior->d_epv->f_packFcomplex))(
687
* Postprocess OUT, INOUT, returns, and exceptions.
690
sidl_String_free(_tmp_key);
691
sidl_Java_CheckException(
694
"sidl.io.IOException",
699
* Method: packDcomplex[]
710
* Declare return and temporary variables.
713
struct sidl_io_Serializer__object* _ior = NULL;
714
char* _tmp_key = (char*) NULL;
715
struct sidl_dcomplex _tmp_value = { 0.0, 0.0 };
716
struct sidl_BaseInterface__object* _ex = NULL;
719
* Preprocess Java types and convert into IOR.
722
_ior = _get_ior(env, obj);
723
_tmp_key = sidl_Java_J2I_string(env, _arg_key);
724
_tmp_value = sidl_Java_J2I_dcomplex(env, _arg_value);
727
* Call the IOR method through the EPV.
730
(*(_ior->d_epv->f_packDcomplex))(
737
* Postprocess OUT, INOUT, returns, and exceptions.
740
sidl_String_free(_tmp_key);
741
sidl_Java_CheckException(
744
"sidl.io.IOException",
749
* Method: packString[]
760
* Declare return and temporary variables.
763
struct sidl_io_Serializer__object* _ior = NULL;
764
char* _tmp_key = (char*) NULL;
765
char* _tmp_value = (char*) NULL;
766
struct sidl_BaseInterface__object* _ex = NULL;
769
* Preprocess Java types and convert into IOR.
772
_ior = _get_ior(env, obj);
773
_tmp_key = sidl_Java_J2I_string(env, _arg_key);
774
_tmp_value = sidl_Java_J2I_string(env, _arg_value);
777
* Call the IOR method through the EPV.
780
(*(_ior->d_epv->f_packString))(
787
* Postprocess OUT, INOUT, returns, and exceptions.
790
sidl_String_free(_tmp_key);
791
sidl_String_free(_tmp_value);
792
sidl_Java_CheckException(
795
"sidl.io.IOException",
800
* Register JNI methods with the Java JVM.
803
void sidl_io_Serializer__register(JNIEnv* env)
805
JNINativeMethod methods[15];
808
methods[0].name = "addRef";
809
methods[0].signature = "()V";
810
methods[0].fnPtr = (void *)jni_addRef;
811
methods[1].name = "deleteRef";
812
methods[1].signature = "()V";
813
methods[1].fnPtr = (void *)jni_deleteRef;
814
methods[2].name = "isSame";
815
methods[2].signature = "(Lsidl/BaseInterface;)Z";
816
methods[2].fnPtr = (void *)jni_isSame;
817
methods[3].name = "queryInt";
818
methods[3].signature = "(Ljava/lang/String;)Lsidl/BaseInterface;";
819
methods[3].fnPtr = (void *)jni_queryInt;
820
methods[4].name = "isType";
821
methods[4].signature = "(Ljava/lang/String;)Z";
822
methods[4].fnPtr = (void *)jni_isType;
823
methods[5].name = "getClassInfo";
824
methods[5].signature = "()Lsidl/ClassInfo;";
825
methods[5].fnPtr = (void *)jni_getClassInfo;
826
methods[6].name = "packBool";
827
methods[6].signature = "(Ljava/lang/String;Z)V";
828
methods[6].fnPtr = (void *)jni_packBool;
829
methods[7].name = "packChar";
830
methods[7].signature = "(Ljava/lang/String;C)V";
831
methods[7].fnPtr = (void *)jni_packChar;
832
methods[8].name = "packInt";
833
methods[8].signature = "(Ljava/lang/String;I)V";
834
methods[8].fnPtr = (void *)jni_packInt;
835
methods[9].name = "packLong";
836
methods[9].signature = "(Ljava/lang/String;J)V";
837
methods[9].fnPtr = (void *)jni_packLong;
838
methods[10].name = "packFloat";
839
methods[10].signature = "(Ljava/lang/String;F)V";
840
methods[10].fnPtr = (void *)jni_packFloat;
841
methods[11].name = "packDouble";
842
methods[11].signature = "(Ljava/lang/String;D)V";
843
methods[11].fnPtr = (void *)jni_packDouble;
844
methods[12].name = "packFcomplex";
845
methods[12].signature = "(Ljava/lang/String;Lsidl/FloatComplex;)V";
846
methods[12].fnPtr = (void *)jni_packFcomplex;
847
methods[13].name = "packDcomplex";
848
methods[13].signature = "(Ljava/lang/String;Lsidl/DoubleComplex;)V";
849
methods[13].fnPtr = (void *)jni_packDcomplex;
850
methods[14].name = "packString";
851
methods[14].signature = "(Ljava/lang/String;Ljava/lang/String;)V";
852
methods[14].fnPtr = (void *)jni_packString;
855
cls = (*env)->FindClass(env, "sidl/io/Serializer$Wrapper");
857
(*env)->RegisterNatives(env, cls, methods, 15);
858
(*env)->DeleteLocalRef(env, cls);