From: Georgios Petasis on 11 Aug 2010 12:59 Hi all, I have written a Tcl extension in Java: public class JavaTest extends Extension { public void init(Interp interp) { /* Register some commands... */ interp.createCommand("creole_JavaTest", new creole_JavaTest()); } public static void SetComponentHome(String path) { System.out.println("JavaTest::SetComponentHome("+path+")"); creole_JavaTest.creole_JavaTest_home = path; } } /* class JavaTest */ My "JavaTest" that is an extension, has a new method "SetComponentHome". Is there a way to call this method? I can load the extension with: java::load -classpath path JavaTest but the JavaTest class seems to disappear after the extension gets loaded. Any ideas on how to call SetComponentHome? George
From: Bruce on 11 Aug 2010 17:14 Georgios Petasis wrote: > Hi all, > > I have written a Tcl extension in Java: > > public class JavaTest extends Extension { > public void init(Interp interp) { > /* Register some commands... */ > interp.createCommand("creole_JavaTest", > new creole_JavaTest()); > } > > public static void SetComponentHome(String path) { > System.out.println("JavaTest::SetComponentHome("+path+")"); > creole_JavaTest.creole_JavaTest_home = path; > } > } /* class JavaTest */ > > My "JavaTest" that is an extension, has a new method "SetComponentHome". > Is there a way to call this method? > > I can load the extension with: > > java::load -classpath path JavaTest > > but the JavaTest class seems to disappear after the extension gets > loaded. Any ideas on how to call SetComponentHome? > > George the docs say you can use java::call to invoke static methods on java classes does that not work? bruce
From: Georgios Petasis on 11 Aug 2010 18:12 Στις 12/8/2010 00:14, ο/η Bruce έγραψε: > Georgios Petasis wrote: >> Hi all, >> >> I have written a Tcl extension in Java: >> >> public class JavaTest extends Extension { >> public void init(Interp interp) { >> /* Register some commands... */ >> interp.createCommand("creole_JavaTest", >> new creole_JavaTest()); >> } >> >> public static void SetComponentHome(String path) { >> System.out.println("JavaTest::SetComponentHome("+path+")"); >> creole_JavaTest.creole_JavaTest_home = path; >> } >> } /* class JavaTest */ >> >> My "JavaTest" that is an extension, has a new method "SetComponentHome". >> Is there a way to call this method? >> >> I can load the extension with: >> >> java::load -classpath path JavaTest >> >> but the JavaTest class seems to disappear after the extension gets >> loaded. Any ideas on how to call SetComponentHome? >> >> George > > > the docs say you can use java::call to invoke static methods > on java classes > > does that not work? > > bruce No. It does not see at all the JavaTest class. I can load it, its init gets called, but somehow it is not visible as a class in tclBlend. George
|
Pages: 1 Prev: Expect & plink returnes special symbol Next: Reg: Automation Framework Design |