You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bsf-user@jakarta.apache.org by "Victor J. Orlikowski" <vj...@dulug.duke.edu> on 2003/02/13 11:34:28 UTC

Re: Dynamic Classpaths with BSF

On Fri, Jan 31, 2003 at 08:12:47PM +0530, Jiger Patel wrote:
> Funny. My Scripting app works fine using Beanshell. Does jython, javascript 
> etc engines ignore the ClassLoader that loaded them?? Since it works with 
> beanshell, ideally it should work for ALL scripting environments. Is there 
> any plan to make setClassPath compulsory for ENgines to implement. If it is 
> done so then such problems can be resolved easily.
> 

Jiger,

As far as BSF is concerned, any class implementing the BSFEngine
interface should be aware of changes to the protected classLoader
and classPath variables that are defined in that interface, which
itself extends a PropertyChangeListener.

However, it may be the case that the individual language engines
do not necessarily check the classLoader variable for changes,
once they are loaded.

Most of the engines simply inherit the propertyChange() method
from BSFEngineImpl. In order for the setClassPath to necessarily
have an effect within the loaded scripting engine, the
propertyChange() method must be overridden within the given
language engine to notify the underlying environment of the
change.

This is not something that can be enforced upon all engine
authors, but I would be willing to apply the changes to the
languages that are currently supported in BSF.

If you would be willing to submit patches to accomplish this, I
would be more than willing to apply them.

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