jakarta-bsf-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dmitry Goldenberg" <dmitry.goldenb...@weblayers.com>
Subject RE: BSF integration sample code - ?
Date Mon, 01 May 2006 21:46:42 GMT
Rony,
 
This helps a lot, thanks.  Where can I see the listing of all the language identifiers?  So
far, I've found "javascript" and "rexx"...
 
Also, is there a snippet to see how Java code is called from inside of a script?
 
Thanks,
- Dmitry
 
 

________________________________

From: Rony G. Flatscher [mailto:Rony.Flatscher@wu-wien.ac.at]
Sent: Mon 5/1/2006 5:35 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: bsf-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bsf-user-help@jakarta.apache.org





Mime
View raw message