theLink 10.0
Loading...
Searching...
No Matches
MqCall_jv.c File Reference

tag: nhi1-release-250425 More...

#include <jni.h>
#include "LibMqMsgque_private_jv.h"
+ Include dependency graph for MqCall_jv.c:

Go to the source code of this file.

Functions

void jvmqmsgque_ServiceCopy (MQ_SERVICE_COPY_ARGS)
 
void jvmqmsgque_ServiceFree (MQ_SERVICE_FREE_ARGS)
 
enum MkErrorE jvmqmsgque_ServiceCall (MQ_SERVICE_CALL_ARGS)
 

Detailed Description

tag: nhi1-release-250425

Definition in file MqCall_jv.c.

Function Documentation

◆ jvmqmsgque_ServiceCall()

enum MkErrorE jvmqmsgque_ServiceCall ( MQ_SERVICE_CALL_ARGS )

Definition at line 31 of file MqCall_jv.c.

32{
34
35 struct MkProcCallS const * const call = (struct MkProcCallS const * const) __data__;
36 JNIEnv *env = call->env;
37
38 // clean JAVA and libmqmsgque error
39 //(*env)->ExceptionClear(env);
40 //MkErrorReset(mqctx);
41
42//printXV(mqctx "%s: self=%p, class=%p, object=%p, method=%p", MqServiceTokenGet(mqctx), self, call->class, call->object, call->method);
43 if (call->hasArg == false) {
44
45 // call the function
46 if (call->class == NULL) {
47 // method call of the same class
48 (*env)->CallVoidMethod(env, call->object, call->method);
49 } else if (call->object == NULL) {
50 // static method call returning an object
51 (*env)->CallStaticObjectMethod(env, call->class, call->method);
52 } else {
53 // method call of an other class
54 (*env)->CallNonvirtualVoidMethod(env, call->object, call->class, call->method);
55 }
56
57 } else {
58
59 jobject self = MqContextC_ObjNewOrNull(env,mqctx);
60
61 // call the function
62 if (call->class == NULL) {
63 // method call of the same class
64 //(*env)->CallVoidMethod(env, call->object, call->method, call->data);
65 (*env)->CallVoidMethod(env, call->object, call->method, self);
66 } else if (call->object == NULL) {
67 // static method call returning an object
68 (*env)->CallStaticObjectMethod(env, call->class, call->method, self);
69 } else {
70 // method call of an other class
71 (*env)->CallNonvirtualVoidMethod(env, call->object, call->class, call->method, self);
72 }
73 }
74
75 // check on error
76 if((*env)->ExceptionCheck(env) != JNI_FALSE) {
77 // is the ERROR from "java" or "jvmkkernel"
78 OT_ERROR_LNG_2_META(mqctx);
79 }
80 return MkErrorStack_0E_Check();
81}
#define mqctx
#define MkErrorStack_0E_Check()
#define MQ_SERVICE_CALL_CHECK

◆ jvmqmsgque_ServiceCopy()

void jvmqmsgque_ServiceCopy ( MQ_SERVICE_COPY_ARGS )

Definition at line 15 of file MqCall_jv.c.

16{
17 struct MkProcCallS * old = (struct MkProcCallS *) *dataP;
18 JavaErrorCheckNULL(*dataP = MK(ProcCreate) (MK_RT_CALL old->env, old->object, old->class, old->method, old->hasArg));
19 return;
20error:
21 MkPanicC_4M(mqctx, __func__, -1, "unable to copy proc data");
22}
#define MkPanicC_4M(errobj, callfunc, errnum, message)
#define MK_RT_CALL

◆ jvmqmsgque_ServiceFree()

void jvmqmsgque_ServiceFree ( MQ_SERVICE_FREE_ARGS )

Definition at line 25 of file MqCall_jv.c.

26{
27 MK(ProcFree) ((struct MkProcCallS **) dataP);
28}