theKernel 10.0
Loading...
Searching...
No Matches
LibMkKernel_jv.c File Reference

tag: nhi1-release-250425 More...

#include "jni_h/jvmkkernel_MkKernel.h"
#include "LibMkKernel_private_jv.h"
#include "MkDefs_jv.h"
+ Include dependency graph for LibMkKernel_jv.c:

Go to the source code of this file.

Macros

#define defDebug0
 
#define defClass(v, n)
 
#define defOAtr(v, c, n, s)
 
#define defSAtr(v, c, n, s)
 
#define defOMth(v, c, n, s)
 
#define defSMth(v, c, n, s)
 
#define MkCleanupTmpl()
 
#define MkSetupTmpl()
 
#define check(v, c)
 
#define defClass(v, n)
 
#define defOAtr(v, c, n, s)
 
#define defSAtr(v, c, n, s)
 
#define defOMth(v, c, n, s)
 
#define defSMth(v, c, n, s)
 
#define defDebug0   MA
 
#define defDebug0
 
#define defClass(v, n)
 
#define defOAtr(v, c, n, s)
 
#define defSAtr(v, c, n, s)
 
#define defOMth(v, c, n, s)
 
#define defSMth(v, c, n, s)
 

Functions

static void jvmkkernel_sMkRuntimeCallback (MK_RT mkrt)
 
JNIEXPORT jobject JNICALL Java_jvmkkernel_MkKernel_ErrorE_1FromInt (JNIEnv *env, jclass class, jint value)
  Java: [static] MkErrorE ErrorE_FromInt(int value) C-API
return the MkErrorE from integer …
 
JNIEXPORT jobject JNICALL Java_jvmkkernel_MkKernel_IdSE_1FromInt (JNIEnv *env, jclass class, jint value)
  Java: [static] MkIdSE IdSE_FromInt(int value) C-API
return the MkIdSE from integer …
 
JNIEXPORT jobject JNICALL Java_jvmkkernel_MkKernel_TimeoutE_1FromInt (JNIEnv *env, jclass class, jint value)
  Java: [static] MkTimeoutE TimeoutE_FromInt(int value) C-API
return the MkTimeoutE from integer …
 
JNIEXPORT jobject JNICALL Java_jvmkkernel_MkKernel_TypeE_1FromInt (JNIEnv *env, jclass class, jint value)
  Java: [static] MkTypeE TypeE_FromInt(int value) C-API
return the MkTypeE from integer …
 
JNIEXPORT jint JNICALL Java_jvmkkernel_MkKernel_ErrorE_1ToInt (JNIEnv *env, jclass class, jobject value)
  Java: [static] int ErrorE_ToInt(MkErrorE value) C-API
return the MkErrorE as integer …
 
JNIEXPORT jstring JNICALL Java_jvmkkernel_MkKernel_ErrorE_1ToString (JNIEnv *env, jclass class, jobject value)
  Java: [static] String ErrorE_ToString(MkErrorE value) C-API
return the MkErrorE as string …
 
JNIEXPORT jint JNICALL Java_jvmkkernel_MkKernel_IdSE_1ToInt (JNIEnv *env, jclass class, jobject value)
  Java: [static] int IdSE_ToInt(MkIdSE value) C-API
return the MkIdSE as integer …
 
JNIEXPORT jstring JNICALL Java_jvmkkernel_MkKernel_IdSE_1ToString (JNIEnv *env, jclass class, jobject value)
  Java: [static] String IdSE_ToString(MkIdSE value) C-API
return the MkIdSE as string …
 
JNIEXPORT jint JNICALL Java_jvmkkernel_MkKernel_TimeoutE_1ToInt (JNIEnv *env, jclass class, jobject value)
  Java: [static] int TimeoutE_ToInt(MkTimeoutE value) C-API
return the MkTimeoutE as integer …
 
JNIEXPORT jstring JNICALL Java_jvmkkernel_MkKernel_TimeoutE_1ToString (JNIEnv *env, jclass class, jobject value)
  Java: [static] String TimeoutE_ToString(MkTimeoutE value) C-API
return the MkTimeoutE as string …
 
JNIEXPORT jint JNICALL Java_jvmkkernel_MkKernel_TypeE_1ToInt (JNIEnv *env, jclass class, jobject value)
  Java: [static] int TypeE_ToInt(MkTypeE value) C-API
return the MkTypeE as integer …
 
JNIEXPORT jstring JNICALL Java_jvmkkernel_MkKernel_TypeE_1ToString (JNIEnv *env, jclass class, jobject value)
  Java: [static] String TypeE_ToString(MkTypeE value) C-API
return the MkTypeE as string …
 
JNIEXPORT void JNICALL Java_jvmkkernel_MkKernel_Cleanup (JNIEnv *env, jclass class)
  Java: [static] Cleanup() C-API
cleanup jvmkkernel internal memory …
 
JNIEXPORT void JNICALL Setup (JNIEnv *env, jclass class)
  Java: [static] Setup() C-API
setup jvmkkernel internal memory …
 
enum MkErrorE jvmkkernel_GetJniEnv (MK_RT mkrt, JNIEnv **env)
 

Variables

JavaVM * jvmkkernel_cached_jvm = NULL
 global data
 
jclass jclass_List
 
jfieldID jfieldID_List
 
jmethodID jmethodID_List
 
static struct MkRuntimeCallbackS jvmkkernel_sMkRuntimeCallbackData = {0}
 
bool MkRuntimeSysPipeHandlerUse = false
 block SIGPIPE ignore handlern default=true, Java require this
 

Detailed Description

tag: nhi1-release-250425

Definition in file LibMkKernel_jv.c.

Macro Definition Documentation

◆ check

#define check ( v,
c )
Value:
if ((v=(c))==NULL) return JNI_ERR

◆ defClass [1/3]

#define defClass ( v,
n )
Value:
jclass v;

Definition at line 22 of file LibMkKernel_jv.c.

◆ defClass [2/3]

#define defClass ( v,
n )
Value:
check(cls, (*env)->FindClass(env, n));\
JavaErrorCheck; \
check(v, (*env)->NewGlobalRef(env, cls)); \
JavaErrorCheck;
#define check(v, c)

Definition at line 22 of file LibMkKernel_jv.c.

◆ defClass [3/3]

#define defClass ( v,
n )
Value:
(*env)->DeleteGlobalRef(env, v);

Definition at line 22 of file LibMkKernel_jv.c.

◆ defDebug0 [1/3]

#define defDebug0

Definition at line 21 of file LibMkKernel_jv.c.

◆ defDebug0 [2/3]

#define defDebug0   MA

Definition at line 21 of file LibMkKernel_jv.c.

◆ defDebug0 [3/3]

#define defDebug0

Definition at line 21 of file LibMkKernel_jv.c.

◆ defOAtr [1/3]

#define defOAtr ( v,
c,
n,
s )
Value:
jfieldID v;

Definition at line 23 of file LibMkKernel_jv.c.

◆ defOAtr [2/3]

#define defOAtr ( v,
c,
n,
s )
Value:
check(v, (*env)->GetFieldID(env,c,n,s)); \
JavaErrorCheck;

Definition at line 23 of file LibMkKernel_jv.c.

◆ defOAtr [3/3]

#define defOAtr ( v,
c,
n,
s )

Definition at line 23 of file LibMkKernel_jv.c.

◆ defOMth [1/3]

#define defOMth ( v,
c,
n,
s )
Value:
jmethodID v;

Definition at line 25 of file LibMkKernel_jv.c.

◆ defOMth [2/3]

#define defOMth ( v,
c,
n,
s )
Value:
check(v, (*env)->GetMethodID(env,c,n,s)); \
JavaErrorCheck;

Definition at line 25 of file LibMkKernel_jv.c.

◆ defOMth [3/3]

#define defOMth ( v,
c,
n,
s )

Definition at line 25 of file LibMkKernel_jv.c.

◆ defSAtr [1/3]

#define defSAtr ( v,
c,
n,
s )
Value:
jfieldID v;

Definition at line 24 of file LibMkKernel_jv.c.

◆ defSAtr [2/3]

#define defSAtr ( v,
c,
n,
s )
Value:
check(v, (*env)->GetStaticFieldID(env,c,n,s)); \
JavaErrorCheck;

Definition at line 24 of file LibMkKernel_jv.c.

◆ defSAtr [3/3]

#define defSAtr ( v,
c,
n,
s )

Definition at line 24 of file LibMkKernel_jv.c.

◆ defSMth [1/3]

#define defSMth ( v,
c,
n,
s )
Value:
jmethodID v;

Definition at line 26 of file LibMkKernel_jv.c.

◆ defSMth [2/3]

#define defSMth ( v,
c,
n,
s )
Value:
check(v, (*env)->GetStaticMethodID(env,c,n,s)); \
JavaErrorCheck;

Definition at line 26 of file LibMkKernel_jv.c.

◆ defSMth [3/3]

#define defSMth ( v,
c,
n,
s )

Definition at line 26 of file LibMkKernel_jv.c.

◆ MkCleanupTmpl

#define MkCleanupTmpl ( )

Definition at line 53 of file LibMkKernel_jv.c.

◆ MkSetupTmpl

#define MkSetupTmpl ( )

Definition at line 54 of file LibMkKernel_jv.c.

Function Documentation

◆ jvmkkernel_GetJniEnv()

enum MkErrorE jvmkkernel_GetJniEnv ( MK_RT mkrt,
JNIEnv ** env )

Definition at line 237 of file LibMkKernel_jv.c.

237 {
238 enum MkErrorE did_attach_thread = MK_OK;
239 *env = NULL;
240 // Check if the current thread is attached to the VM
241 jint get_env_result = (*MK(cached_jvm))->GetEnv(MK(cached_jvm), (void**)env, JNI_VERSION_1_6);
242 if (get_env_result == JNI_EDETACHED) {
243 JavaVMAttachArgs args = {JNI_VERSION_10, "libmqmsgque", NULL};
244 //if ((*MK(cached_jvm))->AttachCurrentThreadAsDaemon(MK(cached_jvm), (void**)env, &args) == JNI_OK) {
245 if ((*MK(cached_jvm))->AttachCurrentThread(MK(cached_jvm), (void**)env, &args) == JNI_OK) {
246 did_attach_thread = MK_OK;
247 } else {
248 // Failed to attach thread. Throw an exception if you want to.
249 did_attach_thread = MkErrorSetC_1E ("Failed to attach thread");
250 }
251 } else if (get_env_result == JNI_EVERSION) {
252 // Unsupported JNI version. Throw an exception if you want to.
253 did_attach_thread = MkErrorSetC_1E ("Unsupported JNI version");
254 }
255 if (*env == NULL) {
256 did_attach_thread = MkErrorSetC_1E ("unable to retrieve 'JNIEnv'");
257 } else if ((**env)->ExceptionCheck(*env)) {
258 did_attach_thread = MkErrorSetC_1E ("exception during retrieving of 'JNIEnv'");
259 }
260 return did_attach_thread;
261}
#define MkErrorSetC_1E(message)
MkErrorE
collection for the different error-codes …
@ MK_OK
(persistent) everything is OK.

◆ jvmkkernel_sMkRuntimeCallback()

static void jvmkkernel_sMkRuntimeCallback ( MK_RT mkrt)
static

Definition at line 37 of file LibMkKernel_jv.c.

37 {
38 // BEGIN-INIT - created by 'jv_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
39
40 NS(MkBufferListC_Init) (MK_RT_CALL_ONLY) ;
41 NS(MkBufferC_Init) (MK_RT_CALL_ONLY) ;
42 NS(MkBufferStreamC_Init) (MK_RT_CALL_ONLY) ;
43 NS(MkErrorC_Init) (MK_RT_CALL_ONLY) ;
44 NS(MkLogFileC_Init) (MK_RT_CALL_ONLY) ;
45 NS(MkObjectC_Init) (MK_RT_CALL_ONLY) ;
46 NS(MkRuntimeC_Init) (MK_RT_CALL_ONLY) ;
47
48 // END-INIT - created by 'jv_MqS.tcl -i NHI1_HOME/theKernel/c/gen/c_mkkernel.meta' - DO NOT change
49}
#define MK_RT_CALL_ONLY

Variable Documentation

◆ jclass_List

jclass jclass_List

Definition at line 17 of file LibMkKernel_jv.c.

◆ jfieldID_List

jfieldID jfieldID_List

Definition at line 18 of file LibMkKernel_jv.c.

◆ jmethodID_List

jmethodID jmethodID_List

Definition at line 19 of file LibMkKernel_jv.c.

◆ jvmkkernel_cached_jvm

JavaVM* jvmkkernel_cached_jvm = NULL

global data

Definition at line 15 of file LibMkKernel_jv.c.

◆ jvmkkernel_sMkRuntimeCallbackData

struct MkRuntimeCallbackS jvmkkernel_sMkRuntimeCallbackData = {0}
static

Definition at line 51 of file LibMkKernel_jv.c.

51{0};