Exemplo n.º 1
0
 public static API_Jni4Net setUpBride(this API_Jni4Net jni4Net)
 {
     return(jni4Net.setUpBride(new BridgeSetup()
     {
         Verbose = true
     }));
 }
Exemplo n.º 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);
        }
Exemplo n.º 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);
     }
 }
Exemplo n.º 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);
     }
 }
Exemplo n.º 5
0
 public static ClassLoader systemClassLoader(this  API_Jni4Net jni4Net)
 {
     return(ClassLoader.getSystemClassLoader());
 }
Exemplo n.º 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));
        }