Rajini Sivaram wrote:
Hello,

Implementation scripts are currently resolved by the thread context
classloader.

The code in  org.apache.tuscany.sca.extension.helper.utils.
ResourceUtil.readResource(String scriptName) is:
    ...
    //FIXME The classloader should be passed in
    ClassLoader cl = Thread.currentThread().getContextClassLoader();
    URL scriptSrcUrl = cl.getResource(scriptName);

I think scripts should be read from contributions, with contribution
import/export semantics, using a model resolver which uses the contribution
classloader.

There is similar code in <implementation.query/> as well which reads the
xquery script using the thread context classloader, which also looks like it
should use a contribution based model resolver.

Thoughts?


Thank you...

Regards,

Rajini


Rajini,

You're right, all of these should use a model resolver for finding script files.

I'd like to raise two related issues:

1) Should we reference script implementation artifacts by script file path or by artifact logical name?
a) <implementation.script script="samples/calculator/calculator.rb"/>
or
b) <implementation.ruby module="calculator"/> for modules and <implementation.ruby class="calculator.Calculator"> for classes

We're currently doing (a). I think that (b) will be better:
- will better fit with the specifics of each scripting language (supporting modules, classes, functions etc.) - more in line with what is done for other languages in SCA (Java, BPEL, etc.) - will also allow you to use modules from a Ruby standard library for example (on the Ruby runtime path).

2) How does the application developer reference script artifacts in imported contributions when the only import mechanisms we have right now are <import> for XML namespaces and <import.java> for Java package names... huh looks like a hole in our import story :)

Implementing model resolvers for the scripts is a good first step, my guess is that it'll lead you to have to resolve (1) and (2) :)

--
Jean-Sebastien


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to