public static Alloc ( object real ) : long | ||
real | object | |
Результат | long |
public static void InitProxy(JNIEnv env, JniLocalHandle obj, object real) { long handle = IntHandle.Alloc(real); env.CallVoidMethod(obj, __IClrProxy._initProxy1, new Value { _long = handle }); }
internal JniLocalHandle CreateJVMProxy(JNIEnv env, object obj) { throw new JNIException("you have to bind native method in order to create proxies to CLR types"); long handle = IntHandle.Alloc(obj); return(env.NewObjectPtr(JVMProxy.jvmHandle, JVMConstructor, new Value(), new Value { _long = handle })); }
private static void RegisterTypeOf(RegistryRecord record, JNIEnv env) { MethodId constructor = knownCLR[typeof(Type)].JVMConstructor; var h = new Value { _long = IntHandle.Alloc(record.CLRInterface) }; var clazz = Type_._class.jvmHandle; var typeInfo = new Value { _object = env.NewObjectPtr(clazz, constructor, Value.Null, h) }; env.CallStaticVoidMethod(record.JVMStatic, "InitJNI", "(Lnet/sf/jni4net/inj/INJEnv;Lsystem/Type;)V", new[] { Value.Null, typeInfo }); //record.JVMStatic.Invoke("InitJNI", "(Lnet/sf/jni4net/inj/INJEnv;Lsystem/Type;)V", null, record.CLRInterface); }