예제 #1
0
        public byte CallByteMethod(JavaObject obj, MethodId methodIdNative, params Value[] args)
        {
            byte res = callByteMethod(envPtr, obj.JvmHandle, methodIdNative.native, args);

            ExceptionTest();
            return(res);
        }
예제 #2
0
        public double CallDoubleMethod(JniHandle obj, MethodId methodIdNative, params Value[] args)
        {
            double res = callDoubleMethod(envPtr, obj, methodIdNative.native, args);

            ExceptionTest();
            return(res);
        }
예제 #3
0
        public short CallShortMethod(JavaObject obj, MethodId methodIdNative, params Value[] args)
        {
            short res = callShortMethod(envPtr, obj.JvmHandle, methodIdNative.native, args);

            ExceptionTest();
            return(res);
        }
예제 #4
0
        public long CallLongMethod(JniHandle obj, MethodId methodIdNative, params Value[] args)
        {
            long res = callLongMethod(envPtr, obj, methodIdNative.native, args);

            ExceptionTest();
            return(res);
        }
예제 #5
0
        public char CallCharMethod(JniHandle obj, MethodId methodIdNative, params Value[] args)
        {
            var res = (char)callCharMethod(envPtr, obj, methodIdNative.native, args);

            ExceptionTest();
            return(res);
        }
예제 #6
0
        public bool CallBooleanMethod(JniHandle obj, MethodId methodIdNative, params Value[] args)
        {
            bool res = callBooleanMethod(envPtr, obj, methodIdNative.native, args) != 0;

            ExceptionTest();
            return(res);
        }
예제 #7
0
        public float CallNonVirtualFloatMethod(JavaObject obj, JniHandle clazz, MethodId methodIdNative, params Value[] args)
        {
            var res = callNonvirtualFloatMethod(envPtr, obj.JvmHandle, clazz, methodIdNative.native, args);

            ExceptionTest();
            return(res);
        }
예제 #8
0
        public double CallNonVirtualDoubleMethod(JniHandle obj, JniHandle clazz, MethodId methodIdNative, params Value[] args)
        {
            var res = callNonvirtualDoubleMethod(envPtr, obj, clazz, methodIdNative.native, args);

            ExceptionTest();
            return(res);
        }
예제 #9
0
        public byte CallStaticByteMethod(JniHandle clazz, MethodId methodIdNative, params Value[] args)
        {
            byte res = callStaticByteMethod(envPtr, clazz, methodIdNative.native, args);

            ExceptionTest();
            return(res);
        }
예제 #10
0
        public JniLocalHandle CallStaticObjectMethod(JniHandle clazz, MethodId methodIdNative, params Value[] args)
        {
            JniLocalHandle res = callStaticObjectMethod(envPtr, clazz, methodIdNative.native, args);

            ExceptionTest();
            return(res);
        }
예제 #11
0
        public short CallStaticShortMethod(JniHandle clazz, MethodId methodIdNative, params Value[] args)
        {
            short res = callStaticShortMethod(envPtr, clazz, methodIdNative.native, args);

            ExceptionTest();
            return(res);
        }
예제 #12
0
        public float CallFloatMethod(JniHandle obj, MethodId methodIdNative, params Value[] args)
        {
            float res = callFloatMethod(envPtr, obj, methodIdNative.native, args);

            ExceptionTest();
            return(res);
        }
예제 #13
0
        public JniLocalHandle NewObject(JniHandle clazz, MethodId methodID, params Value[] args)
        {
            JniLocalHandle res = newObject(envPtr, clazz, methodID.native, args);

            ExceptionTest();
            return(res);
        }
예제 #14
0
        public JniLocalHandle ToReflectedMethod(JniHandle cls, MethodId methodId, bool isStatic)
        {
            JniLocalHandle res = toReflectedMethod.Invoke(envPtr, cls, methodId.native,
                                                          isStatic ? (byte)1 : (byte)0);

            ExceptionTest();
            return(res);
        }
예제 #15
0
 private static void InitializeClassMethods(JNIEnv env)
 {
     if (!mHasInitializedClassMethods)
     {
         JniLocalHandle classClass = env.FindClass("java/lang/Class");
         mGetName                    = env.GetMethodID(classClass, "getName", "()Ljava/lang/String;");
         mGetCanonicalName           = env.GetMethodID(classClass, "getCanonicalName", "()Ljava/lang/String;");
         mGetSuperclass              = env.GetMethodID(classClass, "getSuperclass", "()Ljava/lang/Class;");
         mHasInitializedClassMethods = true;
     }
 }
예제 #16
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;");
        }
예제 #17
0
 public char CallCharMethod(JniHandle obj, MethodId methodIdNative, params Value[] args)
 {
     var res = (char) callCharMethod(envPtr, obj, methodIdNative.native, args);
     ExceptionTest();
     return res;
 }
예제 #18
0
 public byte CallByteMethod(JavaObject obj, MethodId methodIdNative, params Value[] args)
 {
     byte res = callByteMethod(envPtr, obj.JvmHandle, methodIdNative.native, args);
     ExceptionTest();
     return res;
 }
예제 #19
0
 public JniLocalHandle NewObject(JniHandle clazz, MethodId methodID, params Value[] args)
 {
     JniLocalHandle res = newObject(envPtr, clazz, methodID.native, args);
     ExceptionTest();
     return res;
 }
예제 #20
0
 public void CallNonVirtualVoidMethod(JniHandle obj, JniHandle clazz, MethodId methodIdNative, params Value[] args)
 {
     callNonvirtualVoidMethod(envPtr, obj, clazz, methodIdNative.native, args);
     ExceptionTest();
 }
예제 #21
0
 public bool CallBooleanMethod(JniHandle obj, MethodId methodIdNative, params Value[] args)
 {
     bool res = callBooleanMethod(envPtr, obj, methodIdNative.native, args) != 0;
     ExceptionTest();
     return res;
 }
예제 #22
0
 public JniLocalHandle ToReflectedMethod(JniHandle cls, MethodId methodId, bool isStatic)
 {
     JniLocalHandle res = toReflectedMethod.Invoke(envPtr, cls, methodId.native,
                                           isStatic ? (byte) 1 : (byte) 0);
     ExceptionTest();
     return res;
 }
예제 #23
0
 public void CallStaticVoidMethod(JniHandle clazz, MethodId methodIdNative, params Value[] args)
 {
     callStaticVoidMethod(envPtr, clazz, methodIdNative.native, args);
     //TODO result could be tested in Java 1.6
     ExceptionTest();
 }
예제 #24
0
 public byte CallStaticByteMethod(JniHandle clazz, MethodId methodIdNative, params Value[] args)
 {
     byte res = callStaticByteMethod(envPtr, clazz, methodIdNative.native, args);
     ExceptionTest();
     return res;
 }
예제 #25
0
 public long CallStaticLongMethod(JniHandle clazz, MethodId methodIdNative, params Value[] args)
 {
     long res = callStaticLongMethod(envPtr, clazz, methodIdNative.native, args);
     ExceptionTest();
     return res;
 }
예제 #26
0
 public short CallNonVirtualShortMethod(JniHandle obj, JniHandle clazz, MethodId methodIdNative, params Value[] args)
 {
     var res = callNonvirtualShortMethod(envPtr, obj, clazz, methodIdNative.native, args);
     ExceptionTest();
     return res;
 }
예제 #27
0
 public void CallNonVirtualVoidMethod(JniHandle obj, JniHandle clazz, MethodId methodIdNative, params Value[] args)
 {
     callNonvirtualVoidMethod(envPtr, obj, clazz, methodIdNative.native, args);
     ExceptionTest();
 }
예제 #28
0
 public IntPtr CallNonVirtualObjectMethodPtr(JavaObject obj, JniHandle clazz, MethodId methodIdNative, params Value[] args)
 {
     var res = callNonvirtualObjectMethod(envPtr, obj.JvmHandle, clazz, methodIdNative.native, args);
     ExceptionTest();
     return res;
 }
예제 #29
0
        internal void CallStaticVoidMethod(JniHandle clazz, string method, string sig, params Value[] args)
        {
            MethodId idNative = GetStaticMethodID(clazz, method, sig);

            CallStaticVoidMethod(clazz, idNative, args);
        }
예제 #30
0
 public int CallIntMethod(JniHandle obj, MethodId methodIdNative, params Value[] args)
 {
     int res = callIntMethod(envPtr, obj, methodIdNative.native, args);
     ExceptionTest();
     return res;
 }
예제 #31
0
 public double CallDoubleMethod(JniHandle obj, MethodId methodIdNative, params Value[] args)
 {
     double res = callDoubleMethod(envPtr, obj, methodIdNative.native, args);
     ExceptionTest();
     return res;
 }
예제 #32
0
 public short CallStaticShortMethod(JniHandle clazz, MethodId methodIdNative, params Value[] args)
 {
     short res = callStaticShortMethod(envPtr, clazz, methodIdNative.native, args);
     ExceptionTest();
     return res;
 }
예제 #33
0
 public float CallFloatMethod(JavaObject obj, MethodId methodIdNative, params Value[] args)
 {
     float res = callFloatMethod(envPtr, obj.JvmHandle, methodIdNative.native, args);
     ExceptionTest();
     return res;
 }
예제 #34
0
 public void CallStaticVoidMethod(JniHandle clazz, MethodId methodIdNative, params Value[] args)
 {
     callStaticVoidMethod(envPtr, clazz, methodIdNative.native, args);
     //TODO result could be tested in Java 1.6
     ExceptionTest();
 }
예제 #35
0
 public JniLocalHandle CallStaticObjectMethod(JniHandle clazz, MethodId methodIdNative, params Value[] args)
 {
     JniLocalHandle res = callStaticObjectMethod(envPtr, clazz, methodIdNative.native, args);
     ExceptionTest();
     return res;
 }
예제 #36
0
 public void CallVoidMethod(JniHandle obj, MethodId methodId, params Value[] args)
 {
     callVoidMethod(envPtr, obj, methodId.native, args);
     //TODO result could be tested in Java 1.6
     ExceptionTest();
 }
예제 #37
0
 public long CallLongMethod(JavaObject obj, MethodId methodIdNative, params Value[] args)
 {
     long res = callLongMethod(envPtr, obj.JvmHandle, methodIdNative.native, args);
     ExceptionTest();
     return res;
 }
예제 #38
0
 public void CallVoidMethod(JniHandle obj, MethodId methodId, params Value[] args)
 {
     callVoidMethod(envPtr, obj, methodId.native, args);
     //TODO result could be tested in Java 1.6
     ExceptionTest();
 }