Ejemplo n.º 1
0
        public JNIResult AttachCurrentThreadAsDaemon(out JNIEnv penv, JavaVMInitArgs?args)
        {
            if (attachCurrentThreadAsDaemon == null)
            {
                MethodWrapper.GetDelegateForFunctionPointer(functions.AttachCurrentThreadAsDaemon,
                                                            ref attachCurrentThreadAsDaemon);
            }
            IntPtr    env;
            JNIResult result;

            if (args.HasValue)
            {
                JavaVMInitArgs value = args.Value;
                result = attachCurrentThreadAsDaemon.Invoke(native, out env, &value);
            }
            else
            {
                result = attachCurrentThreadAsDaemon.Invoke(native, out env, null);
            }
            if (result == JNIResult.JNI_OK)
            {
                penv = new JNIEnv(env);
            }
            else
            {
                penv = null;
            }
            return(result);
        }
Ejemplo n.º 2
0
 public JNIResult DestroyJavaVM()
 {
     if (destroyJavaVM == null)
     {
         MethodWrapper.GetDelegateForFunctionPointer(functions.DestroyJavaVM, ref destroyJavaVM);
     }
     return(destroyJavaVM.Invoke(native));
 }
Ejemplo n.º 3
0
 public JNIResult DetachCurrentThread()
 {
     if (detachCurrentThread == null)
     {
         MethodWrapper.GetDelegateForFunctionPointer(functions.DetachCurrentThread, ref detachCurrentThread);
     }
     return(detachCurrentThread.Invoke(native));
 }
Ejemplo n.º 4
0
        public JNIResult GetEnv(out JNIEnv penv, int version)
        {
            if (getEnv == null)
            {
                MethodWrapper.GetDelegateForFunctionPointer(functions.GetEnv, ref getEnv);
            }
            IntPtr    env;
            JNIResult result = getEnv.Invoke(native, out env, version);

            penv = new JNIEnv(env);
            return(result);
        }
Ejemplo n.º 5
0
        public JNIResult AttachCurrentThread(out JNIEnv penv, JavaVMInitArgs?args)
        {
            if (attachCurrentThread == null)
            {
                MethodWrapper.GetDelegateForFunctionPointer(functions.AttachCurrentThread, ref attachCurrentThread);
            }
            IntPtr    env;
            JNIResult result;

            if (args.HasValue)
            {
                JavaVMInitArgs initArgs = args.Value;
                result = attachCurrentThread.Invoke(native, out env, &initArgs);
            }
            else
            {
                result = attachCurrentThread.Invoke(native, out env, null);
            }
            penv = new JNIEnv(env);
            return(result);
        }