I have a need to get the classLoader resolved from a contribution after
Node.start. I noticed a couple of things when I try to get it to work.

1. It seems NodeImpl has the list of contribution object who contains the
classLoader. So I used the following code to access it.

*for* (org.apache.tuscany.sca.contribution.Contribution item:
((NodeImpl)node).getContributions())

{

...item.getClassLoader();

}

I wonder if if there is a more elegant way to do it. e.g. If I can get the
org.apache.tuscany.sca.contribution.Contribution from the
org.apache.tuscany.sca.node.Contribution,
then I do not need to interate the contirbutions from the NodeImpl, nor I
need to cast the NodeImpl type

2. When I execute the above code, the classLoader retrieved is null. I
noticed there is no code setting classLoader in the contribution. So I
changed ClassLoaderModelResolver constructor to add the following line .

contribution.setClassLoader(*this*);



I would like to know what is the right way for me to get classLoader for a
given contribution which honors the import statement.

-- 
Thanks. Yang.

Reply via email to