Esempio n. 1
0
		public static void Main(string[] args)
		{
			// http://java.sun.com/docs/books/jni/html/jniTOC.html

			Console.WriteLine("this example is a workaround for: 'already loaded in another classloader' error");
			Console.WriteLine("each plugin will use its own version of a native");

			var x = new PluginMainDelegate
			{
				AssemblyPath = "NativePluginExample_x.jar",
				TypeName = "ExampleCompany.Program",
				NativeAssemblyPath = "lib_jnistb10_x",
			};
			
			// the first call will load the native api
			x.Invoke();
			x.Invoke();

			new PluginMainDelegate
			{
				AssemblyPath = "NativePluginExample_y.jar",
				TypeName = "ExampleCompany.Program",
				NativeAssemblyPath = "lib_jnistb10_y",
			}.Invoke();


		}
Esempio n. 2
0
        public static void Main(string[] args)
        {
            // http://java.sun.com/docs/books/jni/html/jniTOC.html

            Console.WriteLine("this example is a workaround for: 'already loaded in another classloader' error");
            Console.WriteLine("each plugin will use its own version of a native");

            var x = new PluginMainDelegate
            {
                AssemblyPath       = "NativePluginExample_x.jar",
                TypeName           = "ExampleCompany.Program",
                NativeAssemblyPath = "lib_jnistb10_x",
            };

            // the first call will load the native api
            x.Invoke();
            x.Invoke();

            new PluginMainDelegate
            {
                AssemblyPath       = "NativePluginExample_y.jar",
                TypeName           = "ExampleCompany.Program",
                NativeAssemblyPath = "lib_jnistb10_y",
            }.Invoke();
        }