private static void Main() { Init(); // that's CLR implementation of Java interface // java.lang.Runnable have it's proxy in jni4net // you could wrap any interface same way CLRRunnable clrRunnable = new CLRRunnable {Message = "I'm callback"}; // we generated CLR proxy for java.lang.Thread as part of this demo, because it could accept Runnable // generate proxy for your own class/method which could accept Runnable interface Thread javaThread = new Thread(clrRunnable); javaThread.start(); javaThread.join(); }
private static void Main() { Init(); // that's CLR implementation of Java interface // java.lang.Runnable have it's proxy in jni4net // you could wrap any interface same way CLRRunnable clrRunnable = new CLRRunnable { Message = "I'm callback" }; // we generated CLR proxy for java.lang.Thread as part of this demo, because it could accept Runnable // generate proxy for your own class/method which could accept Runnable interface Thread javaThread = new Thread(clrRunnable); javaThread.start(); javaThread.join(); }