The only thing I would add to Rony's answer is the capability to declare "Beans" into your language, and the automatic loading of certain "predefined" languages, so the call to load the scripting engine may not be even needed. To declare beans you create a java class with standard getters and setters and other additional methods. The getter/setter combinations work like properties in your language, and your methods can be called as functions. I usually do javascript and BeanShell integrations and I can use these properties as if they were variables, and call the other methods in my declared beans as function calls, plus these two languages would be preloaded if you drop the right jar in the class path. The biggest trick is finding the right jar to drop with your integration, and it is usually a really simple google search.
The function to declare these beans is BSFManager.declareBean and with that you are set. That is pretty much all the work needed for a very basic integration. - Jaime -----Original Message----- From: Rony G. Flatscher [mailto:[EMAIL PROTECTED] Sent: Monday, May 01, 2006 2:36 PM To: Bean Scripting Framework users Subject: Re: BSF integration sample code - ? Hi Dimitry, > I am new to BSF. Can anyone point me at any BSF integration samples as far as the usage of BSFManager/BSFEngine classes is concerned? > Not sure, what you are looking for, here's a minimal Java program employing BSF (to invoke a scripting language interpreter to execute the supplied program). ------------- cut here ------------- import com.ibm.bsf.*; // BSF support import java.io.*; // exception handling public class TestSimpleExec { public static void main (String[] args) throws IOException { try { BSFManager mgr = new BSFManager (); BSFEngine rexx = mgr.loadScriptingEngine("rexx"); String rexxCode = "SAY 'Rexx was here!'"; rexx.exec ("rexx", 0, 0, rexxCode); } catch (BSFException e) { e.printStackTrace(); } } } ------------- cut here ------------- The above works with Rexx (if interested, get ooRexx from <http://www.ooRexx.org>, and the BSF4Rexx-package containing the latest build of the BSF-package including the Rexx-language at <http://wi.wu-wien.ac.at/rgf/rexx/bsf4rexx/current/>: please read carefully the readmeBSF.txt-file!). Hope that helps, ---rony --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]