public JavaVM(IntPtr native) { this.native = native; functions = *(*(JavaPtr*) native.ToPointer()).functions; Helper.GetDelegateForFunctionPointer(functions.AttachCurrentThreadAsDaemon, ref attachCurrentThreadAsDaemon); Helper.GetDelegateForFunctionPointer(functions.AttachCurrentThread, ref attachCurrentThread); Helper.GetDelegateForFunctionPointer(functions.DestroyJavaVM, ref destroyJavaVM); Helper.GetDelegateForFunctionPointer(functions.DetachCurrentThread, ref detachCurrentThread); Helper.GetDelegateForFunctionPointer(functions.GetEnv, ref getEnv); }
public JavaVM(IntPtr native) { this.native = native; functions = *(*(JavaPtr *)native.ToPointer()).functions; Helper.GetDelegateForFunctionPointer(functions.AttachCurrentThreadAsDaemon, ref attachCurrentThreadAsDaemon); Helper.GetDelegateForFunctionPointer(functions.AttachCurrentThread, ref attachCurrentThread); Helper.GetDelegateForFunctionPointer(functions.DestroyJavaVM, ref destroyJavaVM); Helper.GetDelegateForFunctionPointer(functions.DetachCurrentThread, ref detachCurrentThread); Helper.GetDelegateForFunctionPointer(functions.GetEnv, ref getEnv); }
public JavaVM(IntPtr native) { if (defaultVM != null) throw new Exception("Why is a second VM being initialized?"); this.native = native; defaultVM = this; functions = *(*(JavaPtr*) native.ToPointer()).functions; Helper.GetDelegateForFunctionPointer(functions.AttachCurrentThreadAsDaemon, ref attachCurrentThreadAsDaemon); Helper.GetDelegateForFunctionPointer(functions.AttachCurrentThread, ref attachCurrentThread); Helper.GetDelegateForFunctionPointer(functions.DestroyJavaVM, ref destroyJavaVM); Helper.GetDelegateForFunctionPointer(functions.DetachCurrentThread, ref detachCurrentThread); Helper.GetDelegateForFunctionPointer(functions.GetEnv, ref getEnv); var env = JNIEnv.ThreadEnv; var classLoaderClass = env.FindClass("java/lang/ClassLoader"); findClass = env.GetMethodID(classLoaderClass, "findClass", "(Ljava/lang/String;)Ljava/lang/Class;"); }
public JavaVM(IntPtr native) { this.native = native; functions = *(*(JavaPtr*) native.ToPointer()).functions; }
public JavaVM(IntPtr pointer) { this._jvm = pointer; _functions = *(*(JNIInvokeInterfacePtr *)_jvm.ToPointer()).functions; }
public JavaVM(IntPtr native) { this.native = native; functions = *(*(JavaPtr *)native.ToPointer()).functions; }