/// <summary> /// Calls the static object method. /// </summary> private GlobalRef CallStaticObjectMethod(GlobalRef cls, IntPtr methodId, long *argsPtr = null) { var res = _callStaticObjectMethod(_envPtr, cls.Target, methodId, argsPtr); ExceptionCheck(); return(NewGlobalRef(res)); }
/// <summary> /// Gets the object class. /// </summary> private GlobalRef GetObjectClass(GlobalRef obj) { var res = _getObjectClass(_envPtr, obj.Target); ExceptionCheck(); return(NewGlobalRef(res)); }
/// <summary> /// Calls the long method. /// </summary> public long CallLongMethod(GlobalRef obj, IntPtr methodId, long *argsPtr = null) { var res = _callLongMethod(_envPtr, obj.Target, methodId, argsPtr); ExceptionCheck(); return(res); }
/// <summary> /// Calls the object method. /// </summary> public GlobalRef CallObjectMethod(GlobalRef obj, IntPtr methodId, long *argsPtr = null) { var lref = _callObjectMethod(_envPtr, obj.Target, methodId, argsPtr); ExceptionCheck(); return(NewGlobalRef(lref)); }
/// <summary> /// Calls the static bool method. /// </summary> public bool CallStaticBoolMethod(GlobalRef cls, IntPtr methodId, long *argsPtr = null) { var res = _callStaticBoolMethod(_envPtr, cls.Target, methodId, argsPtr); ExceptionCheck(); return(res > 0); }
/// <summary> /// Converts jstring to string. /// </summary> private string JStringToString(GlobalRef jstring) { if (jstring == null) { return(null); } return(JStringToString(jstring.Target)); }
/// <summary> /// Gets the method identifier. /// </summary> public IntPtr GetMethodId(GlobalRef clazz, string name, string signature) { var res = _getMethodId(_envPtr, clazz.Target, name, signature); if (res == IntPtr.Zero) { throw new IgniteException("Java class method is not found (did you set IGNITE_HOME environment " + "variable?): " + name + " " + signature); } return(res); }
/// <summary> /// Creates a new global reference from a local reference pointer. /// </summary> public GlobalRef NewGlobalRef(IntPtr lref) { if (lref == IntPtr.Zero) { return(null); } var res = new GlobalRef(_newGlobalRef(_envPtr, lref), _jvm); _deleteLocalRef(_envPtr, lref); return(res); }
/// <summary> /// Registers the native callbacks. /// </summary> public void RegisterNatives(GlobalRef clazz, NativeMethod[] methods) { Debug.Assert(methods != null); fixed(NativeMethod *m = &methods[0]) { var res = _registerNatives(_envPtr, clazz.Target, m, methods.Length); if (res != JniResult.Success) { throw new IgniteException("Failed to register natives: " + res); } } }
/// <summary> /// Calls the void method. /// </summary> public void CallVoidMethod(GlobalRef obj, IntPtr methodId, long *argsPtr = null) { _callVoidMethod(_envPtr, obj.Target, methodId, argsPtr); ExceptionCheck(); }
/// <summary> /// Calls the static void method. /// </summary> public void CallStaticVoidMethod(GlobalRef cls, IntPtr methodId, long *argsPtr = null) { _callStaticVoidMethod(_envPtr, cls.Target, methodId, argsPtr); ExceptionCheck(); }