コード例 #1
0
 public static API_Jni4Net setUpBride(this API_Jni4Net jni4Net)
 {
     return(jni4Net.setUpBride(new BridgeSetup()
     {
         Verbose = true
     }));
 }
コード例 #2
0
        public static List <Class> java_From_ClassLoader_get_Loaded_Classes(this API_Jni4Net jni4Net, ClassLoader classLoader)
        {
            var classes = new List <Class>();
            var clClass = classLoader.getClass();

            while (clClass != java.lang.ClassLoader._class)
            {
                "{0} - {1}".info(clClass.str(), clClass.getSuperclass().str());
                clClass = clClass.getSuperclass();
            }

            var classes_Field = clClass.getDeclaredField("classes");
            var classes_Value = classes_Field.get(classLoader);

            var elements_Method = classes_Value.getClass().getMethod("elements", null);
            var elements        = elements_Method.invoke(classes_Value, null);


            while (elements.Invoke <bool>("hasMoreElements", "()Z"))
            {
                classes.add(elements.Invoke <java.lang.Class>("nextElement", "()Ljava/lang/Object;"));
            }

            return(classes);
        }
コード例 #3
0
 public static bool isJVMAvaiable(this API_Jni4Net jni4Net)
 {
     try
     {
         var env = JNIEnv.ThreadEnv;
         var br  = env.FindClass("java/lang/Object");
         return(true);
     }
     catch (System.Exception ex)
     {
         ex.log();
         return(false);
     }
 }
コード例 #4
0
 public static API_Jni4Net setUpBride(this API_Jni4Net jni4Net, BridgeSetup _bridgeSetup)
 {
     jni4Net.bridgeSetup = _bridgeSetup;
     try
     {
         Bridge.CreateJVM(jni4Net.bridgeSetup);
         jni4Net.jniEnv = JNIEnv.ThreadEnv;
         return(jni4Net);
     }
     catch (System.Exception ex)
     {
         ex.log();
         return(null);
     }
 }
コード例 #5
0
 public static ClassLoader systemClassLoader(this  API_Jni4Net jni4Net)
 {
     return(ClassLoader.getSystemClassLoader());
 }
コード例 #6
0
        public static List <Class> java_From_ClassLoader_get_Loaded_Classes(this API_Jni4Net jni4Net)
        {
            var systemClassLoader = ClassLoader.getSystemClassLoader();

            return(jni4Net.java_From_ClassLoader_get_Loaded_Classes(systemClassLoader));
        }