FACT++  1.0
JNIEXPORT jint JNICALL JNI_OnLoad ( JavaVM *  jvm,
void *  reserved 
)

Definition at line 199 of file dim_jni.c.

References CompletionHandler, CompletionHandler_setCompletionCode, DBGx, dim_Dbg_MODULE, dim_jni_attachThread(), dim_JNI_version, JNI_VERSION, NativeDataDecoder, NativeDataDecoder_decodeNativeData, NativeDataEncoder, NativeDataEncoder_encodeNativeData, NativeDataMemory, NativeDataMemory_dataAddress, NativeDataMemory_dataSize, NativeDataMemory_decodeData, NativeDataMemory_new, NativeDimCltError, NativeDimCltError_errorHandler, NativeDimCltError_new, NativeDimExit, NativeDimExit_exitHandler, NativeDimExit_new, NativeDimSrvError, NativeDimSrvError_errorHandler, NativeDimSrvError_new, NativeDimTimer, NativeDimTimer_timerHandler, ourNativeDimCltError, ourNativeDimExit, ourNativeDimSrvError, ourNativeMemoryObject, ReceiveSynchronizer, ReceiveSynchronizer_decodeNativeData, ReceiveSynchronizer_getCompletionCode, ReceiveSynchronizer_new, SendSynchronizer, SendSynchronizer_getCompletionCode, SendSynchronizer_new, SendSynchronizer_setCompletionCode, TheEnv, and theJavaVM.

Referenced by Java_dim_Native_init().

200 {
201  int bugs =0;
202  JNIEnv *env;
203 
204 // DBGe(dim_Dbg_MODULE) ; /* trap only, report on exit */
205 
206  if(reserved){}
207  theJavaVM = jvm;
208 
209  dim_jni_attachThread(&env);
210  TheEnv = env;
211 // (*theJavaVM)->AttachCurrentThread(theJavaVM, (void *)&env, NULL);
212 
213 #ifdef develop_a_better_understanding_of_java
214  {
215  jclass test_cid;
216  jmethodID test_mid;
217 
218  test_cid = (*env)->FindClass(env,"dim/test/Ntest$static_class");
219  test_mid = (*env)->GetMethodID(env,test_cid, "instance_method", "()V");
220  test_mid = (*env)->GetMethodID(env,test_cid, "<init>", "()V");
221  test_mid = (*env)->GetStaticMethodID(env,test_cid, "static_method", "()V");
222  if ((*env)->ExceptionOccurred(env)) (*env)->ExceptionDescribe(env);
223 
224  test_cid = (*env)->FindClass(env,"dim/test/Ntest$instance_class");
225  test_mid = (*env)->GetMethodID(env,test_cid, "instance_method", "()V");
226  test_mid = (*env)->GetMethodID(env,test_cid, "<init>", "()V");
227  if ((*env)->ExceptionOccurred(env)) (*env)->ExceptionDescribe(env);
228 
229  test_cid = (*env)->FindClass(env,"dim/test/Ntest$method_class");
230  test_mid = (*env)->GetMethodID(env,test_cid, "instance_method", "()V");
231  test_mid = (*env)->GetMethodID(env,test_cid, "<init>", "()V");
232  if ((*env)->ExceptionOccurred(env)) (*env)->ExceptionDescribe(env);
233  }
234 #endif
235 
236  NativeDataMemory = (*env)->FindClass(env, "dim/Memory");
237  NativeDataMemory_new = (*env)->GetMethodID (env, NativeDataMemory, "<init>", "()V");
238  NativeDataMemory_decodeData = (*env)->GetMethodID (env, NativeDataMemory, "decodeData", "(JILdim/DataDecoder;)V");
239  NativeDataMemory_dataAddress = (*env)->GetFieldID (env, NativeDataMemory, "dataAddress", "J");
240  NativeDataMemory_dataSize = (*env)->GetFieldID (env, NativeDataMemory, "highWaterMark", "I");
241  NativeDataMemory = (*env)->NewGlobalRef(env, NativeDataMemory);
242  if ((*env)->ExceptionOccurred(env)) {bugs++; (*env)->ExceptionDescribe(env);}
243 
245  ourNativeMemoryObject = (*env)->NewGlobalRef(env, ourNativeMemoryObject);
246  if ((*env)->ExceptionOccurred(env)) {bugs++; (*env)->ExceptionDescribe(env);}
247 
248  SendSynchronizer = (*env)->FindClass(env, "dim/Client$SendSynchronizer");
249  SendSynchronizer_new = (*env)->GetMethodID (env, SendSynchronizer, "<init>", "(Ldim/CompletionHandler;)V");
250  SendSynchronizer_setCompletionCode = (*env)->GetMethodID (env, SendSynchronizer, "setCompletionCode", "(I)I");
251  SendSynchronizer_getCompletionCode = (*env)->GetMethodID (env, SendSynchronizer, "getCompletionCode", "(I)I");
252  SendSynchronizer = (*env)->NewGlobalRef(env, SendSynchronizer);
253  if ((*env)->ExceptionOccurred(env)) {bugs++; (*env)->ExceptionDescribe(env);}
254 
255  ReceiveSynchronizer = (*env)->FindClass(env, "dim/Client$ReceiveSynchronizer");
256  ReceiveSynchronizer_new = (*env)->GetMethodID (env, ReceiveSynchronizer, "<init>", "(Ldim/DataDecoder;)V");
257  ReceiveSynchronizer_decodeNativeData = (*env)->GetMethodID (env, ReceiveSynchronizer, "decodeData", "(Ldim/Memory;)V");
258  ReceiveSynchronizer_getCompletionCode = (*env)->GetMethodID (env, ReceiveSynchronizer, "getCompletionCode","(I)I" );
259  ReceiveSynchronizer = (*env)->NewGlobalRef(env, ReceiveSynchronizer);
260  if ((*env)->ExceptionOccurred(env)) {bugs++; (*env)->ExceptionDescribe(env);}
261 
262  CompletionHandler = (*env)->FindClass(env, "dim/CompletionHandler");
263  CompletionHandler_setCompletionCode = (*env)->GetMethodID(env, CompletionHandler, "setCompletionCode", "(I)I");
264  CompletionHandler = (*env)->NewGlobalRef(env, CompletionHandler);
265  if ((*env)->ExceptionOccurred(env)) {bugs++; (*env)->ExceptionDescribe(env);}
266 
267  NativeDataDecoder = (*env)->FindClass(env, "dim/DataDecoder");
268  NativeDataDecoder_decodeNativeData = (*env)->GetMethodID(env, NativeDataDecoder, "decodeData", "(Ldim/Memory;)V");
269  NativeDataDecoder = (*env)->NewGlobalRef(env, NativeDataDecoder);
270  if ((*env)->ExceptionOccurred(env)) {bugs++; (*env)->ExceptionDescribe(env);}
271 
272  NativeDataEncoder = (*env)->FindClass(env, "dim/DataEncoder");
273  NativeDataEncoder_encodeNativeData = (*env)->GetMethodID(env, NativeDataEncoder, "encodeData", "()Ldim/Memory;");
274  NativeDataEncoder = (*env)->NewGlobalRef(env, NativeDataEncoder);
275  if ((*env)->ExceptionOccurred(env)) {bugs++; (*env)->ExceptionDescribe(env);}
276 
277  NativeDimTimer = (*env)->FindClass(env, "dim/DimTimer");
278  NativeDimTimer_timerHandler = (*env)->GetMethodID (env, NativeDimTimer, "timerHandler", "()V");
279  NativeDimTimer = (*env)->NewGlobalRef(env, NativeDimTimer);
280  if ((*env)->ExceptionOccurred(env)) {bugs++; (*env)->ExceptionDescribe(env);}
281 
282  NativeDimSrvError = (*env)->FindClass(env, "dim/DimErrorHandler$DimSrvError");
283  NativeDimSrvError_new = (*env)->GetMethodID (env, NativeDimSrvError, "<init>", "()V");
284  NativeDimSrvError_errorHandler = (*env)->GetMethodID (env, NativeDimSrvError, "errorHandler", "(IILjava/lang/String;)V");
285  NativeDimSrvError = (*env)->NewGlobalRef(env, NativeDimSrvError);
287  ourNativeDimSrvError = (*env)->NewGlobalRef(env, ourNativeDimSrvError);
288  if ((*env)->ExceptionOccurred(env)) {bugs++; (*env)->ExceptionDescribe(env);}
289 
290  NativeDimCltError = (*env)->FindClass(env, "dim/DimErrorHandler$DimCltError");
291  NativeDimCltError_new = (*env)->GetMethodID (env, NativeDimCltError, "<init>", "()V");
292  NativeDimCltError_errorHandler = (*env)->GetMethodID (env, NativeDimCltError, "errorHandler", "(IILjava/lang/String;)V");
293  NativeDimCltError = (*env)->NewGlobalRef(env, NativeDimCltError);
295  ourNativeDimCltError = (*env)->NewGlobalRef(env, ourNativeDimCltError);
296  if ((*env)->ExceptionOccurred(env)) {bugs++; (*env)->ExceptionDescribe(env);}
297 
298  NativeDimExit = (*env)->FindClass(env, "dim/DimExitHandler$DimExit");
299  NativeDimExit_new = (*env)->GetMethodID (env, NativeDimExit, "<init>", "()V");
300  NativeDimExit_exitHandler = (*env)->GetMethodID (env, NativeDimExit, "exitHandler", "(I)V");
301  NativeDimExit = (*env)->NewGlobalRef(env, NativeDimExit);
302  ourNativeDimExit = (*env)->NewObject(env, NativeDimExit, NativeDimExit_new);
303  ourNativeDimExit = (*env)->NewGlobalRef(env, ourNativeDimExit);
304  if ((*env)->ExceptionOccurred(env)) {bugs++; (*env)->ExceptionDescribe(env);}
305 
306  DBGx(dim_Dbg_MODULE) printf("DimJNI: loaded DLL with dim version %d and JNI %d.%d\n", dim_JNI_version,JNI_VERSION>>16,JNI_VERSION&0xFFFF);
307 
308  return(JNI_VERSION);
309 }
JavaVM * theJavaVM
Definition: dim_jni.c:85
jmethodID NativeDataDecoder_decodeNativeData
Definition: dim_jni.c:109
jmethodID NativeDimTimer_timerHandler
Definition: dim_jni.c:115
jobject ourNativeDimExit
Definition: dim_jni.c:130
jobject ourNativeDimCltError
Definition: dim_jni.c:125
jmethodID NativeDimExit_new
Definition: dim_jni.c:129
JNIEnv * TheEnv
Definition: dim_jni.c:143
jclass NativeDimSrvError
Definition: dim_jni.c:117
jmethodID ReceiveSynchronizer_decodeNativeData
Definition: dim_jni.c:102
jmethodID NativeDimSrvError_new
Definition: dim_jni.c:119
jobject ourNativeDimSrvError
Definition: dim_jni.c:120
jmethodID SendSynchronizer_new
Definition: dim_jni.c:96
jclass ReceiveSynchronizer
Definition: dim_jni.c:100
jmethodID ReceiveSynchronizer_getCompletionCode
Definition: dim_jni.c:103
jmethodID SendSynchronizer_setCompletionCode
Definition: dim_jni.c:97
jclass NativeDataDecoder
Definition: dim_jni.c:108
#define dim_Dbg_MODULE
Definition: dim_jni.h:30
jfieldID NativeDataMemory_dataSize
Definition: dim_jni.c:91
jmethodID SendSynchronizer_getCompletionCode
Definition: dim_jni.c:98
Definition: dim.h:530
jmethodID NativeDimCltError_errorHandler
Definition: dim_jni.c:123
jclass NativeDimCltError
Definition: dim_jni.c:122
jclass CompletionHandler
Definition: dim_jni.c:105
jmethodID NativeDimExit_exitHandler
Definition: dim_jni.c:128
jmethodID NativeDataEncoder_encodeNativeData
Definition: dim_jni.c:112
jobject ourNativeMemoryObject
Definition: dim_jni.c:132
#define DBGx(test)
Definition: dim_jni.c:66
#define JNI_VERSION
Definition: dim_jni.c:39
jclass NativeDimExit
Definition: dim_jni.c:127
jmethodID NativeDimCltError_new
Definition: dim_jni.c:124
jmethodID ReceiveSynchronizer_new
Definition: dim_jni.c:101
#define dim_JNI_version
Definition: dim_jni.c:43
jclass NativeDataMemory
Definition: dim_jni.c:87
int dim_jni_attachThread(JNIEnv **env)
Definition: dim_jni.c:171
jclass SendSynchronizer
Definition: dim_jni.c:95
jmethodID NativeDimSrvError_errorHandler
Definition: dim_jni.c:118
jmethodID CompletionHandler_setCompletionCode
Definition: dim_jni.c:106
jclass NativeDataEncoder
Definition: dim_jni.c:111
jmethodID NativeDataMemory_decodeData
Definition: dim_jni.c:89
jfieldID NativeDataMemory_dataAddress
Definition: dim_jni.c:90
jmethodID NativeDataMemory_new
Definition: dim_jni.c:88
Changes for version
Definition: README_v11.txt:85
jclass NativeDimTimer
Definition: dim_jni.c:114

+ Here is the call graph for this function:

+ Here is the caller graph for this function: