You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bsf-dev@jakarta.apache.org by Don Schwarz <do...@schwarz.name> on 2004/08/07 16:43:05 UTC

[PATCH] BSFEngine Discovery

Hello,

I've attached a patch to BSFManager.java which will allow BSFEngine
implementations to be automatically registered simply by including their
jar in the classpath.

The change that I made was to allow BSFManager.java to search through
all jars in the classpath for org/apache/bsf/Languages.properties files,
rather than simply finding the first match.  This means that BSFEngine
implementations which are distributed separately from BSF can include
within their jar an additional Languages.properties file that specifies
only their own class name.

For example:

[bsf.jar]
org/apache/bsf/Languages.properties:
  javascript = org.apache.bsf.engines.javascript.JavaScriptEngine, js
  ...
  perl = org.apache.bsf.engines.perl.PerlEngine, pl
  ...

[bsfperl.jar]
org/apache/bsf/Languages.properties:
  bsfperl = net.sourceforge.bsfperl.PerlEngineImpl, pl

If BSFManager is run with the above two jars in the classpath, it will
read both Languages.properties files.  It will also resolve the "pl"
extension to the "bsfperl" language, because the
"org.apache.bsf.engines.perl.PerlEngine" class is not located in the
classpath, but "net.sourceforge.bsfperl.PerlEngineImpl" is.

This change should be entirely backwards-compatible.

Thanks,
Don


Re: [PATCH] BSFEngine Discovery

Posted by Sanjiva Weerawarana <sa...@watson.ibm.com>.
"Victor J. Orlikowski" <vi...@alumni.duke.edu> writes:
> On Sat, Aug 07, 2004 at 09:43:05AM -0500, Don Schwarz wrote:
> > I've attached a patch to BSFManager.java which will allow BSFEngine
> > implementations to be automatically registered simply by including their
> > jar in the classpath.
> >
>
> Nice! Applied.

+1!! Finally ...

Sanjiva.


---------------------------------------------------------------------
To unsubscribe, e-mail: bsf-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bsf-dev-help@jakarta.apache.org


Re: [PATCH] BSFEngine Discovery

Posted by "Victor J. Orlikowski" <vi...@alumni.duke.edu>.
On Sat, Aug 07, 2004 at 09:43:05AM -0500, Don Schwarz wrote:
> I've attached a patch to BSFManager.java which will allow BSFEngine
> implementations to be automatically registered simply by including their
> jar in the classpath.
> 

Nice! Applied.

Granted, this may need to be changed slightly, as BSF tries to
implement the interfaces specified in JSR-223...but that's a
little ways ahead.

Thanks,
Victor
--
Victor J. Orlikowski <> victor.j.orlikowski@alumni.duke.edu

---------------------------------------------------------------------
To unsubscribe, e-mail: bsf-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bsf-dev-help@jakarta.apache.org