示例#1
0
        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();
        }
示例#2
0
文件: Program.cs 项目: samiei2/JAJEEM
        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();
        }