This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Embedding kawa in a multi-threaded servlet environment (a few questions).
- From: Chris Dean <ctdean at sokitomi dot com>
- To: Eric Merritt <cyberlync at yahoo dot com>
- Cc: kawa at sources dot redhat dot com
- Date: Tue, 30 Dec 2003 13:46:10 -0800
- Subject: Embedding kawa in a multi-threaded servlet environment (a few questions).
- References: <20031230202740.40064.qmail@web40808.mail.yahoo.com>
Eric Merritt <cyberlync@yahoo.com> wrote:
> All I need to do is create an environment, make some java objects
> available to the script and then kick off the script by name. I would
> prefer that the compiled version of the script be stored and used
> unless it changes, but I have not quite figured out how to go about
> that yet.
I would suggest an alternate style: create a Kawa module that
exposes your Java objects and then just write the script directly
using (require <MyModule>) at the top of the file.
That way you can just compile and execute the script as you would
any JVM program:
unix% echo '(format #t "Hello world~%")' >Foo.scm
unix% java kawa.repl --main -C Foo.scm
(compiling Foo.scm)
unix% java Foo
Hello world
Regards,
Chris Dean