Return-Path: Mailing-List: contact bsf-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list bsf-user@jakarta.apache.org Received: (qmail 14699 invoked from network); 13 Feb 2003 09:34:01 -0000 Received: from atlnga1-ar3-4-62-116-121.atlnga1.dsl-verizon.net (HELO outgoing.verizon.net) (4.62.116.121) by daedalus.apache.org with SMTP; 13 Feb 2003 09:34:01 -0000 Received: (from critter@localhost) by outgoing.verizon.net (8.11.6/8.11.6) id h1D9YCa14828 for bsf-user@jakarta.apache.org; Thu, 13 Feb 2003 04:34:12 -0500 Date: Thu, 13 Feb 2003 04:34:12 -0500 From: "Victor J. Orlikowski" To: "'bsf-user@jakarta.apache.org'" Subject: Re: BSF Questions Message-ID: <20030213043412.D14156@critterling.garfield.home> Mail-Followup-To: "'bsf-user@jakarta.apache.org'" References: <96AB0F4ACC33EF41B0A76870053FF0604EE6A8@cmh0401mai01.amr.stercomm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <96AB0F4ACC33EF41B0A76870053FF0604EE6A8@cmh0401mai01.amr.stercomm.com>; from Gary_Shank@stercomm.com on Thu, Jan 23, 2003 at 04:12:18PM -0500 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 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 -- Victor J. Orlikowski | The Wall is Down, But the Threat Remains! ================================================================== orlikowski@apache.org | vjo@dulug.duke.edu | vjo@us.ibm.com