This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Using Interpreter/classpath within JBoss - XPOST

1 reply
fatbatman
Joined: 2009-02-21,
User offline. Last seen 42 years 45 weeks ago.

Hi,

We're trying to use the Interpreter within JBoss for compiling and running
Scala scripts.

What is the easiest way to tell the Interpreter to use the
Thread.currentThread() classloader
rather than to construct it's own the classpath from the Settings object.

Thanks in advance.

regards

James

Michael
Joined: 2009-02-23,
User offline. Last seen 20 weeks 1 day ago.
Re: Using Interpreter/classpath within JBoss - XPOST

> What is the easiest way to tell the Interpreter to use the
> Thread.currentThread() classloader
> rather than to construct it's own the classpath from the Settings object.

There is no direct way to do this. I had the same problem while working on Scala
scripting support for Apache Sling [1, 2]. My solution was to extend the
compiler such that it can be passed an AbstractFile implementation as part of
its classpath. I then implemented the AbstractFile file system abstraction on
top of the OSGi class loader used by Sling [3].

Michael

[1] http://incubator.apache.org/sling/site/index.html
[2] https://issues.apache.org/jira/browse/SLING-549
[3]
http://svn.apache.org/repos/asf/incubator/sling/trunk/contrib/scripting/...

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland