theKernel 10.0
Loading...
Searching...
No Matches
MkKernel_Setup_libmkkernel_JV_API

MkKernel PACKAGE - Setup und Cleanup the jvmkkernelMore...

+ Collaboration diagram for MkKernel_Setup_libmkkernel_JV_API:

Functions

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 …
 
static native void jvmkkernel.MkKernel.Cleanup ()
  Java: [static] Cleanup() C-API
cleanup jvmkkernel internal memory …
 
static void jvmkkernel.MkKernel.Setup ()
  Java: [static] Setup() C-API
setup jvmkkernel internal memory …
 

Detailed Description

MkKernel PACKAGE - Setup und Cleanup the jvmkkernel

Initializing a jvmkkernel library depends on the Target-Programming-Language (TPL) and the specific nature of the Programming-Language-Micro-Kernel (PLMK).

In general it is required to call a Setup style funtion as FIRST command because of:

If more than one META library is called only the toplevel Setup is required:

shared library detail

A new jvmkkernel library is initialized with Setup and released again with Cleanup. Both functions are automatically called upon loading and unloading of the shared library.

Example: Definition (C) of the jvmkkernel library startup functions

MK_EXTERN void MK_DECL MkSetup (void) __attribute__ ((constructor(200)));
MK_EXTERN void MK_DECL MkCleanup (void) __attribute__ ((destructor(200)));
#define MK_DECL
#define MK_EXTERN
static library
void MkSetup(void)
setup jvmkkernel internal memory …
void MkCleanup(void)
cleanup jvmkkernel internal memory …

In the Programming-Language-Micro-Kernel (PLMK), a type is defined for each thread, which means that the new jvmkkernel library must be known when the thread starts. This is not a problem as long as the external jvmkkernel library is linked to the application. However, if dlopen is used to load the jvmkkernel library, the current restriction is that the new data type from the jvmkkernel library has not been defined in all existing threads.

The point in time when a library is loaded depends heavily on the programming language used.

‍To avoid all the problems call the Setup directly at the start of the main program.

Example: Start of the LcConfigServer application from the example/cs directory

static void Main(string[] argv) {
LcConfig.Setup();
var srv = MqFactoryCT<LcConfigServer>.Add().New();
try {
srv.LinkCreate(argv);
srv.ProcessEvent(MqWaitOnEventE.FOREVER);
} catch (Exception e) {
srv.ErrorCatch(e);
}
srv.Exit();
}

Initializing a jvmkkernel library depends on the Target-Programming-Language (TPL) and the specific nature of the Programming-Language-Micro-Kernel (PLMK).

In general it is required to call a Setup style funtion as FIRST command because of:

If more than one META library is called only the toplevel Setup is required:

shared library detail

A new jvmkkernel library is initialized with Setup and released again with Cleanup. Both functions are automatically called upon loading and unloading of the shared library.

Example: Definition (C) of the jvmkkernel library startup functions

MK_EXTERN void MK_DECL MkSetup (void) __attribute__ ((constructor(200)));
MK_EXTERN void MK_DECL MkCleanup (void) __attribute__ ((destructor(200)));

In the Programming-Language-Micro-Kernel (PLMK), a type is defined for each thread, which means that the new jvmkkernel library must be known when the thread starts. This is not a problem as long as the external jvmkkernel library is linked to the application. However, if dlopen is used to load the jvmkkernel library, the current restriction is that the new data type from the jvmkkernel library has not been defined in all existing threads.

The point in time when a library is loaded depends heavily on the programming language used.

‍To avoid all the problems call the Setup directly at the start of the main program.

Example: Start of the LcConfigServer application from the example/cs directory

static void Main(string[] argv) {
LcConfig.Setup();
var srv = MqFactoryCT<LcConfigServer>.Add().New();
try {
srv.LinkCreate(argv);
srv.ProcessEvent(MqWaitOnEventE.FOREVER);
} catch (Exception e) {
srv.ErrorCatch(e);
}
srv.Exit();
}

Function Documentation

◆ Cleanup()

static native void jvmkkernel.MkKernel.Cleanup ( )
static

Java: [static] Cleanup() C-API
cleanup jvmkkernel internal memory …

◆ Java_jvmkkernel_MkKernel_Cleanup()

JNIEXPORT void JNICALL Java_jvmkkernel_MkKernel_Cleanup ( JNIEnv * env,
jclass class )

Java: [static] Cleanup() C-API
cleanup jvmkkernel internal memory …

Definition at line 220 of file LibMkKernel_jv.c.

220 {
223}
#define MkCleanupTmpl()
#define MkRtSetup_NULL

◆ Setup() [1/2]

static void jvmkkernel.MkKernel.Setup ( )
static

Java: [static] Setup() C-API
setup jvmkkernel internal memory …

Definition at line 263 of file MkKernel.java.

263 {
264 SetupTmpl();
265 }

◆ Setup() [2/2]

JNIEXPORT void JNICALL Setup ( JNIEnv * env,
jclass class )

Java: [static] Setup() C-API
setup jvmkkernel internal memory …

Definition at line 226 of file LibMkKernel_jv.c.

226 {
228 MkSetupTmpl();
229}
#define MkSetupTmpl()