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);
 }
Esempio n. 2
0
 internal JniLocalHandle CreateJVMProxy(JNIEnv env, object obj)
 {
     if (!Bridge.Setup.BindNative)
     {
         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});
 }