Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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;");
        }
Exemplo n.º 4
0
 public JavaVM(IntPtr native)
 {
     this.native = native;
     functions = *(*(JavaPtr*) native.ToPointer()).functions;
 }
Exemplo n.º 5
0
 public JavaVM(IntPtr pointer)
 {
     this._jvm  = pointer;
     _functions = *(*(JNIInvokeInterfacePtr *)_jvm.ToPointer()).functions;
 }
Exemplo n.º 6
0
 public JavaVM(IntPtr native)
 {
     this.native = native;
     functions   = *(*(JavaPtr *)native.ToPointer()).functions;
 }