Beispiel #1
0
        private static JNetVirtualMachine Boot(IJNetBootstrap bootstrap, JavaVM *vm, JNIEnv *env)
        {
            var instance = new JNetVirtualMachine(vm);

            if (bootstrap is not null)
            {
                var runtime = new JNetRuntime(env);

                try
                {
                    bootstrap.Startup(instance, runtime);
                }
                catch
                {
                    instance.Destroy();
                    throw;
                }
            }

            return(instance);
        }
Beispiel #2
0
			internal ManagedJNIEnv()
			{
				pJNIEnv = (JNIEnv*)JniMem.Alloc(sizeof(JNIEnv));
				localRefs = new object[32][];
				active = localRefs[0] = new object[LOCAL_REF_INITIAL_BUCKET_SIZE];
				// stuff something in the first entry to make sure we don't hand out a zero handle
				// (a zero handle corresponds to a null reference)
				active[0] = "";
				localRefIndex = 1;
			}
Beispiel #3
0
 internal JNetRuntime(JNIEnv *env)
 {
     this.env       = env;
     this.functions = env->functions;
 }
Beispiel #4
0
 internal static extern JNI.Result JNI_CreateJavaVM(out JavaVM *jvm, out JNIEnv *env, JavaVMInitArgs *args);