jakarta-bsf-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Victor J. Orlikowski" <...@dulug.duke.edu>
Subject Re: BSF Questions
Date Thu, 13 Feb 2003 09:34:12 GMT
On Thu, Jan 23, 2003 at 04:12:18PM -0500, Shank, Gary wrote:
> I'm writing an app that can execute scripts using BSF v2.3.0.  I would like
> to be able to handle any of the available/supported scripting languages
> which has prompted the following questions:
> 1. Can I register and load scripting engines for all available scripting
> languages/engines using one manager?  Example:
>     BSFManager mgr = new MSFManager();
>     mgr.registerScriptingEngine("engine1", "engine1.Engine", ext1);
>     mgr.registerScriptingEngine("engine2", "engine2.Engine", ext2);
>     mgr.loadScriptingEngine("engine1");
>     mgr.loadScriptingEngine("engine2");
Yes. A single BSFManager instance can handle multiple 
scripting engines simultaneously.

> 2. I'm trying to register and load the BeanShell scripting language
> (bsh-1.2b7.jar) - the register works but the load fails with "unable to load
> language - BSFException.REASON_OTHER_ERROR".
>     String[] ext_bsh = {"bsh"};
>     mgr.registerScriptingEngine("beanshell", "bsh.util.BeanShellBSFEngine",
> ext_bsh);
>     BSFEngine bshEngine = mgr.loadScriptingEngine("beanshell");
Hum. That error indicates some problem w/ instantiating a
bsh.util.BeanShellBSFEngine object or running it's initialize()
method. Could you please do a printStaceTrace() on the
BSFException (try/catch block around loadScriptingEngine) and
reply w/ the output?

> 3. When I was using the jython engine - when I called the
> loadScriptingEngine method for the first time, it took a very long time and
> I noticed that a "cachedir" was added to the directory where the bsf.jar was
> located.  Why and what's it for?
Jython caches Java package information in order to optimize its
performance. As part of this procedure, it creates the cachedir
directory heirarchy. The initial waiting period was probably due
to the initial scan for the cache creation.

Hope that helps,
Victor J. Orlikowski   | The Wall is Down, But the Threat Remains!
orlikowski@apache.org  | vjo@dulug.duke.edu | vjo@us.ibm.com

View raw message