"[g]vim"
, which is available for practically
all platforms and can be downloaded from its homepage at
http://www.vim.org/.
ScriptEngine.eval()
)
the Rexx program
nutshell_01.rex, initially without an argument, then
retrieving the compiled (tokenized) Rexx script and re-evaluate it, this time supplying
arguments from Java to it.
java nutshell_01_eval
javax.script.Invocable
methods to send the Rexx object
messages from Java (using Invocable.invokeMethod(...)
), including arguments. In
addition invoking ooRexx public routines from Java (using Invocable.invokeFunction(...)
)
gets demonstrated.
javax.script.Invocable
methods get
excercised that the ooRexx jsr223-implementation implemented into the compiled (tokenized) Rexx
script support.
java nutshell_02_invoke
javax.script.Invocable
methods to use the public
routines or the methods of the returned Rexx object to implement Java interfaces. This Java
program uses for that purposes the Invocable.getInterface(...)
method.
javax.script.Invocable
methods get
excercised that the ooRexx jsr223-implementation implemented into the compiled (tokenized) Rexx
script support.
To run the Java program enter the following command into a command line window:java nutshell_03_interface
Hint: the external BSF function BSFCreateRexxProxy(rexxObject, [slot], javaInterface...)
allows an easier and much
more powerful creation of Java proxy objects, where the ooRexx methods implement the Java
interface methods. In this case one can declare to Java that multiple Java interfaces are
implemented and it is possible to define a Rexx slot-argument, that will get supplied
each time a Rexx method gets invoked as a result of the Java interface method being run on
the Java side.
ScriptContext
to define the values the Rexx programs should use and
executes three Rexx programs demonstrating the different possibilities to fetch the
values:
java.awt.Dimension
objects named
d1
, d2
, d3
, d4
,
d5
, d6
, d7
, d8
from the supplied ScriptContext
which is always supplied as an entry
named "ScriptContext"
in the slotDir
argument
(a Rexx directory that the RexxScriptEngine
appends as the last argument).
BSFContextVariables()
and the BSF.CLS
public routine
named bsf.ScriptContext2Rexx()
to create Rexx context variables for
all the values available in the supplied ScriptContext
which is always
supplied as an entry named "ScriptContext"
in the slotDir
argument (a Rexx directory that the RexxScriptEngine
appends as the last argument).
ScriptContext
which is always supplied as an entry
named "ScriptContext"
in the slotDir
argument
(a Rexx directory that the RexxScriptEngine
appends as the last argument).
java nutshell_04_eval
java nrxRunScript
java nrxRunScript -h
java nrxRunScript -i
java nrxRunScript -t
java nrxRunScript filename [argument...]
filename
loading the Java script engine
with the help of the
javax.script.ScriptEngineManager
, using the extension in the
filename
. If one or more blank delimited
argument...
were supplied, they will be submitted to the script via the
ARGV
entry in the ScriptContext
. The ooRexx RexxScriptEngine
will
use this array object to create the appropriate arguments for the Rexx script.
java nrxRunScript -e engine filename [argument...]
filename
using the Java script engine
supplied after the -e
switch named engine
with the help of the
javax.script.ScriptEngineManager
. If one or more blank delimited
argument...
were supplied, they will be submitted to the script via the
ARGV
entry in the ScriptContext
. The ooRexx RexxScriptEngine
will
use this array object to create the appropriate arguments for the Rexx script.
Rony G. Flatscher, 2015-06-08, Wien/Vienna, Austria, Europe