jakarta-bsf-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rony G. Flatscher" <Rony.Flatsc...@wu-wien.ac.at>
Subject Re: BSF integration sample code - ?
Date Mon, 01 May 2006 21:35:37 GMT
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,


To unsubscribe, e-mail: bsf-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bsf-user-help@jakarta.apache.org

View raw message